5

I have a csv file which looks like this :

Ref;Code;OtherData;
"MyRef";"-arm";"something";

I think this form is valid, isn't ?

When I open the file in Excel, the "-arm" is parsed by Excel as a formula. How can I force Excel to read the value as plain text ?

If required, I can change the CSV format.

PS: don't ask me to add a leading '. I don't want to adapt the value for a specific app, as other apps must still be able to read the value.

0

3 Answers 3

2

What you need to do is import the csv into excel as "text" so go to data - get external data - from text (2010) and select the csv file. The import wizard will allow you to select columns and treat them with specific formats, any column with a dash or plus can be treated as text and it will not be parsed into a formula.

enter image description here


Additionally, if the data is already in excel and you don't want any formula, do a ctrl+H to find and replace all = with nothing

1
  • 1
    thanks for the tip. I was hoping a solution that can allow double clicking on the csv file with no user intervention. It's still an acceptable solution anyway
    – Steve B
    Commented Feb 23, 2012 at 12:26
-1

You could just use a Find/Replace command on the source replacing - with a space.

2
  • 1
    This will break the csv file
    – Steve B
    Commented Feb 24, 2012 at 9:54
  • 1
    Then the datum will be " arm" instead of "-arm", which is wrong.
    – Old Pro
    Commented Nov 20, 2014 at 21:38
-1

I know this is an old post, but I think what Steve is looking for could be achieved by surrounding the text with double quotes (as he has already done) and then save the csv file in UTF-8 format.

1
  • That will not solve the problem.
    – Old Pro
    Commented Nov 20, 2014 at 21:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .