below is the file from which the data should be copied from a specific line and specific location
CP I ({010010010010010010010010010010}000 000) 234764-CTS_fsdfs_a_inv_33ghf/ZN
--- I ({111100011111100000000000011100}111 111) 2518255-
Q O ({001111100011111100000000000011}111 **1**11) 2520618-
AP I ({010010010010010010010010010010}010 010) 23499764-fdsf_ccl_a_inv_3330gg/XX
--- I ({111111111111111111111100000011}000 000) 2518255-
Q O ({011111110011111111111111100000}000 000) 2909918-
QP I ({110010010010010010010010010010}010 010) 234764-ZZZ_ccl_a_inv_33305/ZZ
--- I ({111111111111111111111100000011}000 000) 2518255-
Q O ({011111111111111111111111100000}000 111) 2599918-
NOTE: the ** are not present in the original file it is there just to help to recognise the digit which to get print into the new file
i have to print the bold letter of the line Q only. and save the content into a new file line by line. And please suggest some code without $3 type of command because while using awk command with $3 it gives error like :
can't read "3": no such variable
Your help is really appreciated
substr()
would be more natural here, IMHO.substr($4,1,1)
. – Kusalananda Aug 04 '22 at 07:23