ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Modification of a .CSV file (https://www.excelbanter.com/excel-discussion-misc-queries/140019-modification-csv-file.html)

[email protected]

Modification of a .CSV file
 
Hi,

I need to do some changes in a .CSV file.
I have two different changes to make:

1) convert the string 111E+112 (scientific notation) to 00111E110
(string with the zeros at the beginning)

2) convert the number 1234567 to 0001234567 - I need to keep the
zeros at the beginning

My problem is that, when I do the changes and save the file back
in .CSV format, all the changes are gone, they are not saved. It's
probably because of the format specifics but I really don't know how
to deal with the problem. I need to find a way to save those change in
a .CSV format.

Does somebody know how to bypass this issue?

Thanks much,


David Biddulph[_2_]

Modification of a .CSV file
 
Are you sure that you've lost the data when you save it as CSV? Have you
looked at the CSV with something like Notepad?

It's likely that you've stored it successfully in the CSV, but that it gets
distorted when you read the CSV back into Excel. If it's OK in the CSV,
copy or rename the CSV as .txt, and then when you read it into Excel you can
specify the relevant columns as text, and thus not get reinterpreted when
you read the data in.
--
David Biddulph

wrote in message
ups.com...
Hi,

I need to do some changes in a .CSV file.
I have two different changes to make:

1) convert the string 111E+112 (scientific notation) to 00111E110
(string with the zeros at the beginning)

2) convert the number 1234567 to 0001234567 - I need to keep the
zeros at the beginning

My problem is that, when I do the changes and save the file back
in .CSV format, all the changes are gone, they are not saved. It's
probably because of the format specifics but I really don't know how
to deal with the problem. I need to find a way to save those change in
a .CSV format.

Does somebody know how to bypass this issue?

Thanks much,




[email protected]

Modification of a .CSV file
 
I did what you said and it is not saving the change. When I save
into .CSV format, I get a message telling me that I might lose
informations if I save it that format instead of .xls format.
Thanks for your help


David Biddulph[_2_]

Modification of a .CSV file
 
Have you actually tried saving it and looking in the CSV file with Notepad?
--
David Biddulph

wrote in message
oups.com...
I did what you said and it is not saving the change. When I save
into .CSV format, I get a message telling me that I might lose
informations if I save it that format instead of .xls format.
Thanks for your help




[email protected]

Modification of a .CSV file
 
Yes I did and the changes are not there either


David Biddulph[_2_]

Modification of a .CSV file
 
What does the data look like in the Excel document from which you are
saving?
What are the cell contents, and what does the cell format say?
What does it then look like in the CSV?
--
David Biddulph

wrote in message
oups.com...
Yes I did and the changes are not there either




Dave Peterson

Modification of a .CSV file
 
It sounds like you may have taken that warning about losing format too
seriously.

If you're worried, save a copy as a normal workbook. Then save it as a .CSV
file.

Then close excel and open that .CSV file in Notepad to verify that it worked.

I'm betting that the second, er, next time you do this, it'll work fine.

wrote:

Yes I did and the changes are not there either


--

Dave Peterson


All times are GMT +1. The time now is 03:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com