-
DBFCSV: Conversion between DBF and CSV files
Access this help text as a web page: DBFCSV
Presentation and options
This application converts files from the DBF format (dBASE tables in classic DBF format or in extended DBF) to the CSV format (export of Excel tables) and vice versa.
In the conversion from DBF to CSV the list separator can be chosen, which is usually a semicolon (";"). Also, it accepts the special word "TAB" (without quotes) to choose the tabulator as a list separator.
The first row of the generated CSV will contain the names of the fields, which will be converted into the columns of the CSV file.
In the inverse conversion, from CSV to DBF, the separator that has been used in the CSV to generate the different columns must be chosen (any doubts, the file with a text editor can be opened and check which separator is being used; Note that if there are quotation marks (double: "), they usually delimit a text that contains a field separator that should not be interpreted as such, or serve, if they are duplicated, to indicate a simple quote that should consist of a text character).
The first row of the CSV can contain the names of the columns and, in such case, these names can be adopted as names of the fields of the DBF that is generated.
In MiraMon the main tables associated with files that are layers with geographic or geometric contents (graphics layers, etc) are in DBF or extended DBF format, and always have a column (typically the first) used to store what is called graphic identifier (ID_GRAFIC). This is used to give each graphic object a set of attributes, geometric-topological or thematic. In case the CSV does not have this column of graphic identifiers, it can be indicated that it is generated automatically during the import to DBF
In MiraMon the DBF tables can go beyond the limitations of the dBASE IV format (which it is call classic DBF, see the document dedicated to the extended DBF -available in catalan-) but this is not possible in other cases, such as in the tables corresponding to layers in Shape format. Therefore, the application offers the possibility of restricting the conversion of CSV to DBF within the limits of the format of a classical DBF; note that in this case, as is logical, fields may be lost, or parts of field content, or the field names may need to be simplified, etc, because it is not possible to incorporate this information into a classical DBF.

Dialog box of the application

Syntax
Syntax:
- DBFCSV 1 FitxerOrigenDBF FitxerDestiCSV [/SEPARA]
- DBFCSV 2 CampIdGrafic Capçalera DBFClassica FitxerOrigenCSV FitxerDestiDBF [/SEPARA] [/DOBLE_QUALIF] [/QUALIF_TEXT]
Options:
- 1:
Conversion from DBF to CSV.
- 2:
Conversion from CSV to DBF.
Parameters:
- FitxerOrigenDBF
(Input file -
Input parameter): Name of the DBF file to be converted.
- FitxerDestiCSV
(Output file -
Output parameter): Name of the CSV output file.
- CampIdGrafic
(Field of the graphic identifier -
Input parameter): It has a value of 0 if a column with the field that contains the graphic identifier is desired to de added, if it exists; otherwise the value is 1.
- Capçalera
(CapHeader of the first row. -
Input parameter): It has a value of 1 if the first row of the CSV file is wanted to be used as the header of the DBF (which contains the names of the fields of the DBF).
- DBFClassica
(Restriction to classic DBF -
Input parameter): It has a value of 1 if the conversion of CSV to a non-extended DBF (classic) is restricted, otherwise the value is 0. In this case, the DBF will be correctly marked (if it is extended it can be seen in "Information | Table information" when opening the table in MiraDades).
- FitxerOrigenCSV
(Input file -
Input parameter): Name of the CSV file to be converted.
Modifiers:
/SEPARA= (Separator) In the conversion from DBF to CSV, the list separator can be chosen, which is usually a semicolon (";"). It also accepts the special word "TAB" (without quotes) to choose the tabulator as a list separator. In the inverse conversion, from CSV to DBF, the separator that has been used in the CSV to generate the different columns must be chosen (for any doubt, a file with a text editor can be opened and check which separator is being used; keep in mind that if there are quotes is because they usually delimit a text that will end up in the same field, or they are used, if they are doubled, to indicate single quotation marks that must appear as a text character). (Input parameter) /DOBLE_QUALIF=
(Double qualifier)
It can be set to CARACTER_NORMAL (if the qualifier is " and it finds "", it considers it a single quote, which is useful for supporting arcseconds in a string while also allowing strings with quote qualifiers) or QUALIF (an option that treats the double qualifier as a qualifier character, and therefore defines an empty string). CARACTER_NORMAL is the default value. (Input parameter) /QUALIF_TEXT=
(Text qualifier)
It can take the following values: CAP, APOSTROF, COMETES, APOSTROF_EXCEPTE_SI_TAB, COMETES_EXCEPTE_SI_TAB (Input parameter)
