Leading zeros in CSV file

Hi All,

My source data in OLEDB Source and Destination is CSV.

Below is the sample data

claim claim_number
123 000123
124 000124
125 0000125

But while loading OLEDB source data into CSV in Claim_Number column not considering the leading zeros and getting output as below.

claim claim_number
123 123
124 124
125 125

is it possible to handle with script to get the leading zeros ????

September 13th, 2015 3:34am

Perhaps you can use Conversion task to CAST it as INT?
Free Windows Admin Tool Kit Click here and download it now
September 13th, 2015 5:52am

Hi harikiran,

if your not really worried about data type in csv (retain same datatype as in table) then you can have a derived column and have the expression adding leading single quotation mark ('). I think that way when you load into csv it will have leading zeros. But that column in csv will no longer be NUMERIC. It will be TEXT.

September 13th, 2015 11:54am

Hi All,

My source data in OLEDB Source and Destination is CSV.

Below is the sample data

claim claim_number
123 000123
124 000124
125 0000125

But while loading OLEDB source data into CSV in Claim_Number column not considering the leading zeros and getting output as below.

claim claim_number
123 123
124 124
125 125

is it possible to handle with script to get the leading zeros ????

Be sure that your claim_number column is configured to be a string when importing or exporting to save those leading zeros.

Same goes for importing:

EXPORT RESULTS:

id,claim_number
123,000123
124,000124
125,0000125

I hope that helps!

Free Windows Admin Tool Kit Click here and download it now
September 13th, 2015 12:32pm

It could be an issue with your csv file.

Check the tata type of your csv file column.

September 13th, 2015 9:08pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics