How to replace single quote to double quote by awk when under Windows? -


i tried gsub() didn't work. here command:

awk -v a="'"  b=" \" "  "gsub(a,b,$0){print $0}" d:\re.json 

or tell me right escape character in windows command line?

as suggested, put script file. referring windows, understand context windows batch-files (rather say, mingw has own problems command-line scripting). windows batch files

  • double-quotes eaten before program sees them
  • there no well-documented way escape double-quotes
  • single-quotes passed as-is program (and not, in bourne shell, used quoting).

here few links issues discussed:

so rules entirely different awk needs construction. last link way gives clues might use devise workaround (at expense of readability). discussed in escaping double quotes in batch script.

as separate file, script more readable, e.g., call foo.awk:

gsub("'"," \" ",$0){print $0} 

and use as

awk -f foo.awk d:\re.json 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -