Config Files
From version 1.5, CSVfix provides two features implemented via configuration files. These are default options which will be applied to all commands, and the ability to create command aliases. These features are specified by configuration files. The files are called csvfix.cfg if running on Windows, and .csvfix if running on one of the UNIX-like operating systems. CSVfix looks for a configuration file first in the current working directory, and then in the user's home directory, which the directory specified by the USERPROFILE environment variable on Windows, and HOME on the UNIX-like systems. The path to the actual config file used can be seen by running CSVfix with no command-line parameters.
The configuration file is a text file which consists of a number of configuration commands and/or comments. Comments are any lines where the first non-blank character is a '#'. Commands are lines beginning with either defaults or alias.
To specify default options, use the defaults command. For example, this command:
defaults -smq -sep ';'
says that you always want smart quoting to be on, and that you always want the CSV separator to be a semicolon. You can specify only one defaults command per configuration file.
To specify aliases, use the alias command. This example sets lsempty to be an alias for a find command that lists any records that have empty fields in them:
alias lsempty find -e '^$'
Once you have this alias defined, you can use lsempty like other csvfix commands:
csvfix lsempty mydata.csv
You can specify multiple aliases in a configuration file.
Created with the Personal Edition of HelpNDoc: Create HTML Help, DOC, PDF and print manuals from 1 single source