this is the feed file,
dfscmd /map "\\SERVER24\dfs\shared\can\Group Pension\Quality Assurance Auditors" "\\serverfile16\bugp-qaaud$" ""
dfscmd /map "\\SERVER24\dfs\userhome\serverfile52_d" "\\serverfile52\userhome_d" ""
dfscmd /map "\\SERVER24\dfs\shared\can\Wealth Management\WM CSC Stats - Support Team, CRT Team & CSR Performance" "\\serverfile48\bucan-WM_CSC_Support_&_CRT_Team_Stats" ""
Using this line
gawk -v FS=""" "{print $2 \";\" $4 }" a.txt
I am able to print but I cannot save the output,
C:\>gawk -v FS=""" "{print $2 \";\" $4 }" a.txt >b.txt
\\SERVER24\dfs\shared\can\Group Pension\Quality Assurance Auditors;\\serverfile16\bugp-qaaud$
\\SERVER24\dfs\userhome\serverfile52_d;\\serverfile52\userhome_d
\\SERVER24\dfs\shared\can\Wealth Management\WM CSC Stats - Support Team, CRT Team & CSR Performance;\\serverfile48\bucan- WM_CSC_Support_&_CRT_Team_Stats
gawk: (FILENAME=a.txt FNR=3) fatal: cannot open file `>b.txt' for reading (Invalid argument)
Single quotes should always be used to surround
awk‘s braces. This would be better:Contents of
b.txt:EDIT:
If you’re using windows, you may also like to consider running a script like this:
Contents of
script.awk:This avoids having to wrap quotes around your expression and produces the results you require. HTH.