I tried gsub() but it didn't work. Here is the command:
awk -v a="'" b=" \" " "gsub(a,b,$0){print $0}" D:\re.json
or anybody could tell me what is the right escape character in Windows command line?
I tried gsub() but it didn't work. Here is the command:
awk -v a="'" b=" \" " "gsub(a,b,$0){print $0}" D:\re.json
or anybody could tell me what is the right escape character in Windows command line?
As suggested, put the script into a file. Referring to Windows, we would understand the context to be Windows batch-files (rather than say, mingw which has its own problems with command-line scripting). For Windows batch files
Here are a few links where those issues are discussed:
So the rules are entirely different from what awk needs for this construction. The last link by the way gives some clues that you might use to devise a workaround (at the expense of readability). It is also discussed in Escaping Double Quotes in Batch Script.
As a separate file, the script would also be more readable, e.g., call that foo.awk
:
gsub("'"," \" ",$0){print $0}
and use it as
awk -f foo.awk D:\re.json