I have a file that looks like this:
d "Text 1":6,64;1 /filesys1/db1.d2
d "Text 2":6,64;1 /filesys1/db1.d2 f 730
d "Text 3":6,64;1 /filesys1/db1.d2
d "TextA":6,64;1 /filesys1/db1.d2 f 46000
d "TextB":6,64;1 /filesys1/db1.d2
d "TextC":6,64;1 /filesys1/db1.d2 f 120000
...
I need to get everything from quotes, and then to the last two characters of the line and put them in a new file. I can do two parts separately, but I cannot combine them and make them work.
awk -F'"' '$0=$2' datatmp4 > dataout2
will get me:
Text 1
Text 2
Text 3
TextA
TextB
TextC
and
awk '{ print substr( $NF, length($NF) -1, length($NF) ) }' datatmp4 > dataout
will get me:
d2
30
d2
00
d2
00
what I need:
Text 1 d2
Text 2 30
Text 3 d2
TextA 00
TextB d2
TextC 00
source
share