norseman wrote:
The norm is: Each variable has to be unique in order to be discernible.
The exception occurs in Excel. When line 1 has the same text in different columns and the file is written out as a CSV, duplicate field names are kept. Excel, when making CSV or DBF files, voids the rules and neither are then directly usable in data base work. Excel is position based only. Labels mean nothing. I recently had to work with a set of files in which each had three different field names repeated 36 times each. I had to write a black box to straighten them (several hundred files) out for subsequent use.

This is true with Microsoft Excel and I suspect true with Calc when outputting CSV files. But it is not true with Calc in respect to DBF files.

When converting to a DBF files, Microsoft Excel shortens the field name to 10 characters uppercased and changes it minimally to fit DBF format, but otherwise leaves it unchanged. Any duplicate field names that result from this process will remain duplicated, creating a bad DBF file.

OpenOffice.org Calc also shortens the field name to 10 characters uppercase and changes it minimally to fit DBF format. But if there are any duplicate names in the result list of field names, some of the names are changed minimally in the final characters so that all output field names are unique.

We have to do lots of conversions from Excel to DBF at work, and Calc is a godsend to us.

Calc also spaces the output fields appropriately so that no truncation occurs, handles blank rows, and always asks what code page we want the DBF to appear as, unless we set this in macro or external program.

Excel is a horror when it comes to converting files to DBF format.

However if I am converting a file from Unicode to a DBF code page, then Calc abends with an error message if there is any character that won’t convert. This can be horrible if you try to fix it by finding the character, typing in a substitute, and then trying to convert again, and having Calc find another character. The best thing to do in such a situation is to convert the file into a Unicode tab delimited text file, convert that file to the code page I want, and then create a DBF structure into which to append the converted text file.

Note for those who wonder, DBF files do not accept Unicode format.

Jim Allan


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to