• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 588
  • Last Modified:

save file as .csv

I have a template which is in .csv file. One column, I want to format it as Number, decimal place set to 0.  It asked me to save. When click yes, "xxxx.csv may contain features that are not compatible iwth CSV(comma delimited). Do you want to keep the workbook in this format?"

Is this possbile to format cell?
0
VBdotnet2005
Asked:
VBdotnet2005
3 Solutions
 
Kelly HasenmuellerComputer Systems Administrator Commented:
There is probably an easier way to do this but here is what I do:

Once you format it to your liking, try saving it as a txt file. This will preserve the formatting. Reopen the txt file with excel, making sure you use delimited, resave as csv. This will have the newly formatted cell.
0
 
VBdotnet2005Author Commented:
if account number like

111111111111
it turns to 1.11111e+11
is it possbile to leave it 111111111111 ?
test.csv
test.txt
0
 
VBdotnet2005Author Commented:
I tried to follow your advice above. I could not get it to work.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
tdlewisCommented:
You cannot store cell formatting in a CSV file.

Excel will save the data in whatever format it determines will allow the values to be reloaded correctly.

I created a CSV file similar to what you're describing. If 12-digit numbers are displayed with a format of "0" then Excel stores them in the CSV as 12-digit numbers. However, if I re-open the file, the numbers are displayed by default in engineering notation. If I save the file without changing the cell format to "0" then Excel stores the values in engineering notation.

You could manually run a macro that changes the cell formatting to "0" every time you open the file, but I don't think there is a way to do what you want automatically.
0
 
mo_patelCommented:
you can format data in a CSv file using excel but it will not save the format details i.e. if one column is decimal, nxt is date and so on.

This is only possible if you save as an excl file.

CSV are simple files like txt files.
0
 
DIIRECommented:
I've tried to duplicate your problem but everytime I save as a csv it doesn't change the format of the number.

What version of Office are you using?

Try setting the field as text or general before you save as csv and see if this helps.

Otherwise would you be able to provide a sample spreadsheet in excel that you are trying to save as csv.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now