Hello everyone!! I'm having an issue I hope someone can help me with. I have a data file that's comma delimited, but there are 14 lines that have 2 quotes in front of the text and 2 quotes after the text. Ex. ""abcdefg"". The data should read, "abcdefg". Can you please tell me how I can pull the ""abcdefg"" data out of the file using grep, or any other command? Any help with this will be greatly appreciated.
Thanks,
Larry
You can easily get the lines containing adjacent double quotes with:
grep '""' file
or, perhaps slightly faster with:
grep -F '""' file
or:
fgrep '""' file
Are you really sure the data should read "abcdefg" ?? Using doubled double-quotes is, for instance, IBMs way of denoting a "second quoting level" in LPAR profiles, for instance:
attribute="string1"
but
"attribute=""string1 with spaces"",""string2 with spaces"",""[...]"""
like here:
hscroot@hmc # lssyscfg -r prof -m myMS --filter "lpar_names=mylpar"
name=default_profile,lpar_name=mylpar,lpar_id=1,lpar_env=aixlinux,[...]
"virtual_fc_adapters=""4/client/2/vios1/41/c0507608ac0c000c,c0507608ac0c000d/0"",""5/client/3/vios2/41/c0507608ac0c000e,c0507608ac0c000f/0""",
[...]
I hope this helps.
bakunin