Missing row delimeter {CR}{LF} in .txt file

  • I have a .txt file, I am suppose to put the data in the .txt file into a table in a database.

    I generally deal such type of task using Import Export Wizard (or) SSIS.

    But in this perticular .txt file there is no row delimeter "{CR}{LF}".

    Can any one suggest me the ways to put the row delimeter "{CR}{LF}" after every 40 charecters (As per the Spects) in that .txt file.

    So that I can load the data into the Data Base Table.

  • I am not aware of any "handy" tool to exactly what you want.

    If it were me I would write a little .net utility to read the file and write it back out to another file in the correct format. It would take maybe 20 lines of code to do this.

    The probability of survival is inversely proportional to the angle of arrival.

  • I dont think you have to do anything like that, just make you SSIS flat file source , "Fixed width".



    Clear Sky SQL
    My Blog[/url]

  • If all the "fields" in the file line up vertically, one of the best bets is to make a "BCP Format File" and use BULK INSERT to load the file.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Is there anything special with the character #40?

    In this case you can copy and paste the content to Microsoft Word or Outlook and do a Replace replacing this character with the same character followed by CR/LF. To get special characters in Word or Outlook, in the Replace window click More button and then Special button. I use this feature to say, replace commas with CR/LF or CR/LF with commas.

    YV

    Regards,Yelena Varsha

  • Yelena Varshal (3/1/2011)


    Is there anything special with the character #40?

    Hex or decimal?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply