Export 16 digit value as String in CSV from Database

Seven Stars

Export 16 digit value as String in CSV from Database

Dear All,

 

I am trying to extract a report from DB in csv.

The column in the DB is Varchar and the value is a 12 digit number.

After the export the value is treated as number by the excel once we open the file.

is it possible to force export the value as String from DB into csv ?

 

E.g 934581347349,

this is exported as number however this is stored as varchar in DB which is displayed as 934581E+11

Now if i am trying to update some other column in same csv file and save it then the above value is changed to 934581000000(935E+11),

when talend reads this csv file it reads it as 935+11

 

Pease suggest any solution to make sure that 934581347349 is exported as 934581347349 and even reimported as 934581347349

Note: The export and import file format has to be csv

Thanks

Vidya

 

 


Accepted Solutions
Fifteen Stars TRF
Fifteen Stars

Re: Export 16 digit value as String in CSV from Database

The problem is due to Excel which consider a cell containing digits only as a number.
You can try to concatenate a single quote with the value with the following expression "'"+row1.myField but you will probably have to remove it when you will read the file again with the next job.
Hope this helps.

TRF

All Replies
Fifteen Stars TRF
Fifteen Stars

Re: Export 16 digit value as String in CSV from Database

The problem is due to Excel which consider a cell containing digits only as a number.
You can try to concatenate a single quote with the value with the following expression "'"+row1.myField but you will probably have to remove it when you will read the file again with the next job.
Hope this helps.

TRF

What’s New for Talend Spring ’19

Join us live for a sneak peek!

Sign up now

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads