Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFFILE writing to CSV and number format issue

Status
Not open for further replies.

Bygbobbo

Programmer
Apr 23, 2002
145
US
Has anyone come up with a solution for keeping leading zeros in a number field when you write to a csv file.

e.g. 00000045 --> 45 (on csv when open in a spreadsheet)

Currently, the only solution I have is putting a dash in front of the number before it writes to the file.

e.g. -00000045 --> -00000045 (on csv when open in a spreadsheet)

I have tried using blank spaces but that still removes the leading zeros.


Thanks in advance,
Bygs
 
Try putting a leading single quote, like this: '00000045. This works in Excel and Lotus 1-2-3.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top