I am creating csv file for importing into Excel. Some values are strings (123).
I need them to show as (123). Excel shows them as -123.
Which characters can I add to (123) to make Excel show them as (12开发者_Python百科3), without any need for post-import manual formatting ?
Tried double-quotes, did not help. Thanks.
If you store it as ="(123)"
excel will store it as text. Make sure not to leave any space preceding the equals sign.
for example: "data",="(123)","more data"
Try a leading single quote -- '
Did you try +123 instead? I tried the following data and it works fine.
Name,Number
Howard,+123
I had the same problem. I created a csv file in a web application. The file contained strings and numbers. The problem was that some of the strings where interpreted as numbers by Excel (like an employee id 12345).
The solutions I've found is to add a ALT-255 symbol to every string. It looks as a space to the human viewer, but Excel handles it different. The string setup in this way , will be handled as a string.
I hope someone can use this tip!
精彩评论