I'm having difficulties finding how to match a particular word when this word begin also by a question mark inside a CSV file. I need to use tcsh code.
What I mean it that I can match "cat" while excluding "zcat" but it includes "?cat". Here is my code:
#!/bin/tcsh -f
set viewSet = PRE_IMPL
set nbViewSet=`awk -F ";" '{ for (i=1; i<=NF; i++) { if ($i == "VIEW SETS") print i } }' csv.csv`
/usr/bin/awk -F ";" -v col="$nbViewSet" '(match($col, '"/\<"$viewSet"\>/"') != 0) {print}' csv2.csv
So with this code, I have what follows as an input CSV file:
STANDARD KEYS;COMPATIBLE KEYS;CELL KEY;COND KEY;WORKSPACE PATH;VIEW PATH;CATEGORIES;CONDS SECTION;VIEW SETS;TYPES
;;;;;;;;PRE_IMPL;
;;;;;;;;zPRE_IMPL;
;;;;;;;;?PRE_IMPL;
;;;;;;;;PRE_IMPL;
So here I want to match only the word "PRE_IMPL" and neither "zPRE_IMPL" nor "?PRE_IMPL". My code manage to exclude "zPRE_IMPL" but not "?PRE_IMPL" and I didn't manage to change that, the output is:
;;;;;;;;PRE_IMPL;
;;;;;;;;?PRE_IMPL;
;;;;;;;;PRE_IMPL;
How do I change my code to match "PRE_IMPL" only?