Computing.Net > Forums > Office Software > excel- importing csv entrries

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to get for your free account now!

excel- importing csv entrries

Reply to Message Icon

Name: rinsitah
Date: June 9, 2005 at 15:41:05 Pacific
OS: win2k sp4
CPU/Ram: p4
Comment:

Hi there,
I was just wondering if anyone else has had this problem:
We create a CSV file with a whole bunch of stock codes. Many of these stock codes start with the number "0" eg 01SD4. when the csv file is read into excel, the entries beginning with 0 are truncated. eg 01SD4 -> 1SD4. Looking at the documentation, it seemed that if we put a ' at the beginning of the code (eg '01SD4) it should read it as text and disply correctly. HOWEVER when we read the new csv file in (the one with the ' before all the entries beginning with 0) excel will disply the whole entry still, including the ' .... the funny thing is, if you edit the entry, dont change anything and hit enter, the ' goes away...

is there any way to read in the csv file and display properly without the ' but with the 0 straight away without goign through all 3000 lines and changing the ones with ' ???


Report Offensive Message For Removal

Sponsored Link
Ads by Google

Response Number 1
Name: Jennifer SUMN
Date: June 9, 2005 at 16:25:12 Pacific
Reply:

Instead of just opening the csv file in Excel, create a new Worksheet. Then:

Data
Get External Data
Import Text File
Show All Files
Browse to the csv file
Next
Select Comma Only
Text Qualifier - None
Next
Highlight all data
Column Data Format
Text (as opposed to the default General)
Finish
OK

That's it...



Report Offensive Follow Up For Removal

Response Number 2
Name: rinsitah
Date: June 9, 2005 at 18:13:26 Pacific
Reply:

Hi. Thanks for your reply, but it still dosnt work. After doing all that it still displays the codes with the ' infront of them. The only way to get rid of them seems to be to edit the cell, change nothing and hit enter.


Report Offensive Follow Up For Removal

Response Number 3
Name: Jennifer SUMN
Date: June 9, 2005 at 19:02:15 Pacific
Reply:

If your csv file has the apostrophe in the "field", then of course the spreadsheet will have them. I guess I misunderstood. I based my answer on your original statement "Many of these stock codes start with the number "0" eg 01SD4. when the csv file is read into excel, the entries beginning with 0 are truncated. eg 01SD4 -> 1SD4". I assumed you were going to import your original csv file that didn't contain the edited information.


Report Offensive Follow Up For Removal

Response Number 4
Name: rinsitah
Date: June 9, 2005 at 19:05:43 Pacific
Reply:

ah ok. Thatll go.
Thing is the people that use the csv want to just click it and it to be ready for them to use... I might have to make a macro... (these are users that cant get their heads around "run the file" or other similar simple statements, so trying to get them to do the whol;e data impot thing will probably be a stretch.

Thanks for you efforts tho! Much appreciated, this is why I come to this site for answers.

CHEEEEEERS!


Report Offensive Follow Up For Removal

Response Number 5
Name: Bryco
Date: June 10, 2005 at 11:13:19 Pacific
Reply:

If all of the codes contain 5 characters then just format that column's cells using the Custom or Special format and make it ##### so it will be 5 characters long.
(I don't have Excel on this machine so I can not verify if the "#" is the correct operator or not but it says the correct info under Help)

HTH
Bryan


Report Offensive Follow Up For Removal

Related Posts

See More



Response Number 6
Name: Bryco
Date: June 10, 2005 at 11:26:01 Pacific
Reply:

Ok, I went to my other PC.
Use 00000 (5 zeros) unless the .csv does contain the ' when imported. Or during the import do not assign the ' to the formatting.

Bryan


Report Offensive Follow Up For Removal
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: excel- importing csv entrries

Importing CSV in Excel, choosing file www.computing.net/answers/office/importing-csv-in-excel-choosing-file/8751.html

Excel Import www.computing.net/answers/office/excel-import/2469.html

missing email fields when importing www.computing.net/answers/office/missing-email-fields-when-importing/7778.html