Shell Specific Behavior
How to cope with various shell restrictions
Generally: quote commands with blank spaces or special characters
On every shell a white space usually separates one command line argument from the previous and the next one.
Other characters might be used for certain shell-specific functions.
If such characters or blank spaces occur, it is always necessary to quote the command or at least the expression embedding it, to prevent "misunderstandings".
Windows Batch files: the code page problem
Here is what can be done if umlauts are necessary when calling csvfox.
The following Windows batch file (something.bat) is in ANSI format (here: Windows-1252).
It needs the Euro (€) sign, but the standard code page 850 does not support this character.
So the batch file temporarily switches to codepage 1252, and defines the variable
After this, it calls csvfox with command parameters, and on every place where "€" would be needed, it uses "
@echo off &setlocal
chcp 1252>nul
set "euro=€"
chcp 850>nul
csvfox kfz.csv +rename[Price],[Brand]=NetPrice,CarType %[Tax]=1.19 +add[GrossPrice]=(([NetPrice])*[Tax]) +add[Phrase]="My new [CarType] costs {([GrossPrice])2} %euro%!" +add[Expensive]={(([NetPrice])*1)2} car-done.csv %log=log-%%Y.txt
A different way to handle this might be using the %paramfile option.
A parameter file has the local Windows default encoding (e.g. CP1252 = Windows-1252). So if you place the commands there, you overcome the restrictions of the CP850 commandline processor and can also use the locally supported diacritical characters directly.
Additionally, a parameter file can have an explicit encoding:
%paramfile/utf-8=myparameters.txt
so if you work with UTF-8 is is also possible to embed any code point of unicode charset.
Linux bash: avoid expansion
Linux shell immediately expands wildcards like * and ? as placeholders for file names, instead of forwarding these signs to the called program.
You can suppress this expansion with the setting "-f".
This can be done this way:
set -f csvfox *locale=en-US (...)set +f
Powershell: avoid special characters handling
Use "--%" as the first parameter for csvfox, if using powershell.
This will stop handling #, % etc. as special functions, and allow the shell to interpret them as characters.
If used often, it might be a good idea to prepare a csvfox command script that always inserts the "--%" parameter as a first argument.
cmd /c 'csvfox ...' is an alternative to --%.
Please pay attention to the single quotes which must surround the whole command line!
überprüfen!
@ as first char in at parameter wird leider immer noch vergessen.