Quoting

Introduction ››
Parent Previous Next

Some parameters of CSVfix commands will require quoting. These are typically those that specify strings containing spaces, or those that use the expression language. For example, this find command requires quotes around the name being searched for in the books.csv file:


csvfix find -f 3 -s 'Great Expectations' books.csv


The type of quotes you need to use will vary with the shell you are using, but in general you should use double-quotes if you are using the Windows cmd.exe shell, and single quotes if you are using a shell such as bash. This also affects the quoting for the expression language. Using cmd.exe:


csvfix eval -e "if( $1 == 'Emma', 'Based in Surrey', 'Somewhere else')" books.csv


while when using bash:


csvfix eval -e 'if( $1 == "Emma", "Based in Surrey", "Somewhere else")' books.csv


Failure to use the correct quotes will result in strange error messages, such as:


ERROR: Cannot open Expectations' for input



Created with the Personal Edition of HelpNDoc: Full-featured Kindle eBooks generator