J
JimmyKoolPantz
Task: Customer wants a script of the data that was processed in a
"CSV" file.
Problem: Zip-Code leading zeros are dropped
Basically we have a client that has requested a custom script for each
file that he has us process. He wants this in a Comma Delimited
Format.
I did some research and noticed everyone has the same problem I have,
with the leading zero's not being brought over during the conversion.
I did not find the answer I was looking for so, i am posting this to
see if someone has a possible solution.
The original files are in a .dbf format. I load the dbf file into
memory and then change the column headers as the client has requested,
and planned on writing out to a filestream. However, when I do this,
and open the .csv file, my leading zeros are missing.
I have tried putting an apostrophy in front of the number (example:
'0001) and open the csv file, the leading zeros are there but i have
an apostrophy in front of the number.
Basically, what i'm trying to accomplish here is create a few
functions that saves the data as a .csv file (retain leading zeros)
and upload the file to the customers ftp site. I do not want to
convert it, and then open the file and change column formats. I just
want to do this programmically without playing with it.
Any suggestions?
"CSV" file.
Problem: Zip-Code leading zeros are dropped
Basically we have a client that has requested a custom script for each
file that he has us process. He wants this in a Comma Delimited
Format.
I did some research and noticed everyone has the same problem I have,
with the leading zero's not being brought over during the conversion.
I did not find the answer I was looking for so, i am posting this to
see if someone has a possible solution.
The original files are in a .dbf format. I load the dbf file into
memory and then change the column headers as the client has requested,
and planned on writing out to a filestream. However, when I do this,
and open the .csv file, my leading zeros are missing.
I have tried putting an apostrophy in front of the number (example:
'0001) and open the csv file, the leading zeros are there but i have
an apostrophy in front of the number.
Basically, what i'm trying to accomplish here is create a few
functions that saves the data as a .csv file (retain leading zeros)
and upload the file to the customers ftp site. I do not want to
convert it, and then open the file and change column formats. I just
want to do this programmically without playing with it.
Any suggestions?