comma separated column text file

  • I have a text file with three columns

    col1,col2 and col3 . col2 is column of address but this column has commas for example: 11,down street, London. now because of this commas my number of columns increase since each comma makes a different column. how to work out with this column (address column). I want this full address to be written as it is with commas in col2(column2).

  • scottichrosaviakosmos (3/24/2011)


    I have a text file with three columns

    col1,col2 and col3 . col2 is column of address but this column has commas for example: 11,down street, London. now because of this commas my number of columns increase since each comma makes a different column. how to work out with this column (address column). I want this full address to be written as it is with commas in col2(column2).

    Look into the text qualifier option for csv files.

    Basically your data should look like:

    col1,col2,col3

    blablabla,"11,down street, London",blablabla

    An even better solution is to make sure that not the comma is used as delimiter, but a symbol that is not used much.

    The pipe | is an ideal character. To be 100% sure, you could combine it with yet another character such as $. The chance that you have legitamate text with |$ in it is quite small I think.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 2 posts - 1 through 1 (of 1 total)

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