Copy the csv grammar file, change the ; to a \ or
and create a new grammar w/ that file.
Sounds easy, doesn't it? Assume you meant replace , not ; since there are no ; in the file. But there are a bunch of , in the file and not a few \ already there as well. I was making an assumption that if I just went through and changed all the instances of , to \ it would just create mess, and since I'm not particularly good at regular expression type stuff I was hoping someone who is would be able to jump in and do it with no difficulty.
# JBoland, 9/29/03 - Grammar to parse CSV files
# Parses fields separated by commas. All fields are used in the key
WS [\t\n ]*
ext_fields COMMA WS VAL WS $new_field $2 $append_field_to_var \
$VAR_REC $2 %ext_fields
record WS VAL WS $new_field $1 $save_var $VAR_REC $1 \
%ext_fields $save_record $VAR_REC
add $write_fields $0 $VAR_COMMA
Or is it just the comma in the first line that I need to replace?
OK. I copied csv.gm to ssv.gm and ran this command (thanks Stephan):
blcli -v defaultProfile -r BLAdmins ConfigFileGrammar createConfigFileGrammarOnFileServer "/opt/bmc/bcas/NSH/scripts" "ssv.gm" "ssv.gm" "Slash Grammar (ssv.gm)" "Modified from CSV to Slash Sep Values"
When I choose the new grammar for my extended object it returns nothing (again, this is before I have modified the new grammar file in any way). Not sure what's wrong.
i think you want to change the VAR_COMMA to \ as you note. maybe \\. then retry. it's blank becasue it can't parse the config file/EO.
What I'm saying is that even without making any changes to csv.gm it doesn't work. I copied csv.gm to ssv.gm and ran the blcli command to make it available in the config object dictionary. The new grammar doesn't work even though the file contents are still identical to csv.gm. Something seems to have gone wrong with the blcli command to add the new grammar file.
What kind of file uses a \ as a delimiter ?