Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

3 Answers 3

up vote 2 down vote accepted

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

share|improve this answer
    
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 Feb 23 '12 at 12:26
add comment

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.

share|improve this answer
add comment

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

share|improve this answer
    
This will break the csv file –  Steve B Feb 24 '12 at 9:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.