Now i would like to add the directory ahead of the filename. Therefore a backslash needs to be added at the end of $0 or in my case the var p. This does not work, though when I add a word it works.
Output with a string:
gawk" "/ Directory of / {p=substr($0,14)} {if (NF>3) {print p " test " $4}
Output:
C:\Users\User\Documents test file1.txt 48.322
C:\Users\User\Documents test file2.txt 9.216
C:\Users\User\Documents test file1.txt 26.793
Can anybody help?
gawk" "/ Directory of / {p=substr($0,14)} {if (NF>3) {print p \"\\\" $4}
All these varietys return an empty file:
{print p \"\\\" $4} = empty file
{print p "\\" $4} = empty fileFB_Addon_TelNo{ height:15px !important; white-space: nowrap !important; background-color: #0ff0ff;}
Desired output with backslash between the var p and filename
C:\Users\User\Documents\file1.txt
C:\Users\User\Documents\file2.txt
C:\Users\User\Documents\file2.txt
---------- Post updated at 06:05 PM ---------- Previous update was at 01:58 PM ----------
Yes the operating system is Windows 7 on Command line with dos. Since i can't get the backslash to be passed. How about getting this backslash with getline < backslash.txt containing only the backslash. Can somebody help on the code for file input in an one liner?