• Quick note - the problem with Youtube videos not embedding on the forum appears to have been fixed, thanks to ZiprHead. If you do still see problems let me know.

csv text files and MS Excel

Safe-Keeper

My avatar is not a Drumpf hat
Joined
Jun 18, 2007
Messages
13,851
Location
Norway
OK, so here's the problem. I'm editing a strings file from a game (Battlefield 2142, should this matter any) with the Excel spreadsheet program, and when I try to save it, regardlessly of whether or not I've made edits, it tells me that the document "may contain functions incompatible with Unicode text". If I proceed to save it, its format changes completely and the game won't run it.

For whatever it's worth, the file uses tabs to separate columns and '' as delimiters.
 
Although I can't answer about Excel, perhaps you could give OpenOffice.org a try; in my limited experience, it seems to actually handle CSV files better than MS Office.
 
OK, so here's the problem. I'm editing a strings file from a game (Battlefield 2142, should this matter any) with the Excel spreadsheet program, and when I try to save it, regardlessly of whether or not I've made edits, it tells me that the document "may contain functions incompatible with Unicode text". If I proceed to save it, its format changes completely and the game won't run it.

For whatever it's worth, the file uses tabs to separate columns and '' as delimiters.

How do you mean that the "format changes completely?" What, specifically happens to it?

Also, if it uses tabs to separate the columns isn't it techncially a TTD file, not a CSV?

How big is this file, anyway? If it's not too much of a monster, I would think simply using a decent text editor would make more sense than going through the whole dance of bringing it into Excel, editting it, and then exporting it back into the appropriate text format.
 
How do you mean that the "format changes completely?" What, specifically happens to it?

Also, if it uses tabs to separate the columns isn't it techncially a TTD file, not a CSV?

How big is this file, anyway? If it's not too much of a monster, I would think simply using a decent text editor would make more sense than going through the whole dance of bringing it into Excel, editting it, and then exporting it back into the appropriate text format.

Yeah - csv stands for comma separated values. It sounds like it is in a unicode format that Excel isn't handling properly. Unicode make use of more then one byte per display character. If Excel can't write it out correctly it will very easily corrupt the file. You may have to upgrade your Excel if it is old. If the file is indeed unicode, then any text editor used will also have to be unicode compliant.
 
Yeah - csv stands for comma separated values. It sounds like it is in a unicode format that Excel isn't handling properly. Unicode make use of more then one byte per display character. If Excel can't write it out correctly it will very easily corrupt the file. You may have to upgrade your Excel if it is old. If the file is indeed unicode, then any text editor used will also have to be unicode compliant.

Yep. I'm not so sure the encoding of the text file would matter, but the formatting sure would. If Excel changes anything (say it adds or strips a tab stop or something), then it might be enough to mess up the game code that reads through the file.

Anyway, Safe-Keeper, any chance you could post a sample copy of the file or something? I'd be happy to run it through Excel to see what Excel is doing to the file.
 
Apologies in advavance if the following question is somehow insulting...

When you SAVE the file, are you simply using the plain old ordinary type of SAVE?

If so, in Excel, that will default to a .xls format. Instead, use File \ Save As and (in the 'files of type' option) select csv

Another option is to use a text editor - like Notepad or (the one I recommend) SciTE, both of which handle Unicode without a hiccup :)
 
Thanks for all the replies. I'm downloading a 60-day trial version of the latest Excel. It might work better with Unicode files than the current one.

Also supplied sample for Jonny:).
 

Attachments

Last edited:
You may want to try Notepad++, it is free and available from http://notepad-plus.sourceforge.net/uk/site.htm
and a portable version at http://portableapps.com/apps/development/notepadpp_portable
Excel will interpret csv files. A few years ago one of the DBA's decided that we could gather data from the field using standard csv files. The only problem is that there is no such thing as a standard csv file. Some of the files could not be read into the database but looked fine in Excel, however when viewed in Notepad++ the problems could then be seen and corrected. This data transfer systems was only meant to be around a few months.
 
OK, downloaded a 60 day version of MS Office 2007, which allowed me to choose Unicode-8 as the format for imported files. It works now:).
 
OK, downloaded a 60 day version of MS Office 2007, which allowed me to choose Unicode-8 as the format for imported files. It works now:).

That's good. From the looks of your file, the older version of Excel was probably just stripping out some identifier the game was looking for (my copy seemed to strip out a bunch of stuff when it opened the file). Anyway, glad it works.
 

Back
Top Bottom