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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

csv to excel problem

Status
Not open for further replies.

gregor weertman

Programmer
Sep 29, 2000
195
NL
I have a CSV file:
213.230, bla
234.555, dsdas
344.300, etc

when I upload to excel 213.230 becomes 213.23 and
344.300 344.3.

These numbers are meant as strings not int.

How can I format my csv file so excel uploads correctly.

regards Gregor.

Gregor.Weertman@mailcity.com
 
Gregor,

When you're importing the file are you using the file open command,
if so then Excel will open the CSV file as it sees fit.
If instead you use Data, Get External Data, Import Text File then you have a lot morte control over how each individual field is imported.

DH.
 
Hi,

CSV to Excel has no way to intervene in the parsing conversion. Excel assumes that all numeric values are numbers.

Here's how you can confition your data after it has been imported. I am assuming that there are to be 3 digits following the decimal. Are there ALWAYS 3 digits BEFORE the decimal so that the form should be...

nnn.nnn

If that's the case, then...
if your digits are in column A starting in row 1, the conditioned string is
Code:
=A1&LEFT("000",7-LEN(A1))
Hope this might help :)

Skip,
Skip@TheOfficeExperts.com
 
is there no way I can format the CSV so
excel understands?

Gregor.Weertman@mailcity.com
 
When using the TRootls, Get External data, Import Text Files method you can specify for each field that the import should be as a string and then you get the data as it is held in the file.

DH
 
Try using a single quote ' before each item eg '213.230 rather than double quotes eg "213.230 or "213.230". Excel will show each item as a string but the quote will not be present when you open it.
 
That's the thing about CSVs - Comma Seperated VALUES - therefore it assumes that unless explicitly stated, everything is a VALUE rather than text

Rgds
Geoff
Si hoc legere scis, nimis eruditionis habes
Get the best answers to your questions - faq222-2244
 
The single quote is shown in the worksheet.

I tried dif. Excel also screws that.

$@#$@#!!

I give up.

Thanks to you all

Gregor.Weertman@mailcity.com
 
Gregor, I am using Excel 2002. When I open a csv file with a file type of .txt, Excel opens a dialog called the "Text Import Wizard" that allows me to define how I want Excel to interpret the data. Step 3 of that wizard allows me to define the 'value' 123.456 to text, and loads it as such.

enjoy
 
My goal was to just click the csv and import it without intervening.

I think it's just not possible with Excel.

Regards Gregor.


Gregor.Weertman@mailcity.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top