Link to home
Start Free TrialLog in
Avatar of chima
chima

asked on

MS Excel cell value is transformed

Hello,
I'm doing a .csv file export from an application.  For most of the data the Event ID is presented correctly in Excel, except those that have a "12-" prefix.  I'm trying to convince the DBA that it is because of the database representation.  Maybe I am wrong, but I would like to know.
The image below shows the Dec-54 and Dec-84 which should be 12-1954 and 12-2284, respectively.
I tried changing the format of the cells, but the 12-XXXX does not show up.  And because I have done nothing to the other cells, which are correct, these cells should be correct as well.  The Dec- values show up in the .csv file as well.  In both .xlsx and .csv have the problem.
User generated image
SOLUTION
Avatar of Jacques Geday
Jacques Geday
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chima
chima

ASKER

gowlfow, sorry I can't.  I am able to do a .xls export from the same app and it does show these cells correctly, and they have a "General" format setting.  The others are "General" as well.  So, it might be the transition from .csv to the .xlsx.  Maybe it is the .xlsx that it does not like.  If I change it to .xls might that resolve the problem.
Try selecting Text as Column Data Format for that particular column during the import from the text file and see if that issue gets resolved.
Instead of opening the CSV file directly, I recommend importing it as a text file.

After selecting the file (menu: Data, Get External Data group, From Text), choose "Delimited".  On the next screen, choose "Comma" as the delimiter, click [Next >].  On the last screen, click on the column with the hyphenated values (ex, "12-1954") and click the "Text" option.  Click [Finish].

User generated image
I tested this on a sample csv file that I created in a text editor and it worked.  Here is the sample content:
Blue,WTF,14-3479
Green,GW-352 TB,14-0126
Blue,WTF-KU1A,12-2284
Blue,WTF-KU1B,12-1954

Open in new window

Avatar of chima

ASKER

sktneer and Ray, followed Ray's instructions and some cell are fine, but others still display the Dec-
User generated image
Avatar of chima

ASKER

I think the proper format/setting has to come from the database.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
^This.  Please see my sample screenshot; the window on the right (step 3 of 3) shows what you should see when you click on that column and then select "Text" as the column data format.
Avatar of chima

ASKER

aikimark yes I tried it again.  This time I formated that column as "text" and the results are the same.  Other than not initializing that column, I did follow Glenn's instructions.
File attached
Text-column.csv
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chima

ASKER

Glenn Ray, thank you for your response.  Your comment is the point I'm hoping to solve; " I'm trying to convince the DBA that it is because of the database representation."  You and the others responding have proven the point that the proper data string needs to originate at the database.  I'll be closing this ticket shortly.
Avatar of chima

ASKER

Thank you all