I have a SSIS package with .CSV file where -


my origional data below format

 col1             col2                              col3 

"225537-009 | ca, sas led, 2pin-2pin, 16", env | 1.95

i have ssis package creates .csv file when file created got below kind of output in file

col1             col2                          col3    col4 

"225537-009 | ca, sas led, 2pin-2pin, 16 | env" | 1.95

here column delimiter =comma{,} , row delimiter= " please suggest me need change original data

"225537-009 | ca, sas led, 2pin-2pin, 16", env | 1.95 

this confusing and/or invalid csv data, since 'first field' quoted.

with , separator valid 2-field data:

225537-009 | ca, sas led, 2pin-2pin, 16 , env | 1.95

with | separator however, invalid data since have , env after quote in first field.

to fix, double quotes should escaped:

""225537-009 | ca, sas led, 2pin-2pin, 16"", env | 1.95 

or even:

"""225537-009" | "ca, sas led, 2pin-2pin, 16"", env" | 1.95 

or should make sure parser ignores double quotes (but have problems if field contains separator).


in case first data (3) columns in database, csv writer should escape double quotes, , output following (with , separator):

"""225537-009","ca, sas led, 2pin-2pin, 16"", env",1.95 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -