For both tasks, the options are to use a CSV (Comma-separated values) or a tab-delimited TXT file. To the best of my knowledge, Microsoft Word does not export to either of these formats, leaving us to work with Excel, which does.
For those who choose to upload a TXT file, there are some hurdles to overcome. Itracks requires quotation marks around all the fields. Excel, however, does not generate TXT files with both a field delimiter and quotation marks.
What to do?
To date, I had been using a rather tedious search-and-replace approach (open the TXT file with Notepad, search-and-replace the tab characters with "TAB", insert a quotation mark at the beginning of the file, and at the end of each line). Tedious & error-prone.
I've discovered a better way. Run a macro (in Excel) that will write selected records to a text file with both tab and quote delimiters.
Microsoft has written such a macro and provides it, as is. You can find it on their support site under the heading Procedure to export a text file with both comma and quote delimiters in Excel.
Wait, you say. we don't want comma and quote, we want tab and quote. No worries. Follow the directions on the Microsoft site to load up the macro in a new worksheet. Once you've pasted in the macro, edit it to replace the line
Print #FileNum, ",";CHR(9) is the code for the tab character.
with
Print #FileNum, chr(9);
Now, whenever you need to export from Excel to Itracks in a TXT format, select the cells and call up the edited macro to generate the TXT file in the correct format.
Alternatively, you can download this Excel spreadsheet from my site. It contains the macro already loaded. The usual warnings apply.
Don't forget to change the encoding of the file to UTF-8 if you are working in a international-language Itracks account. More on that in another post.
0 comments:
Post a Comment