0
Good afternoon to all,
I have a text file with several lines with fixed columns:
11Sala 1:4 FF
The first column has the ID, and the second has the data I want to get (1:4
), but when I have lines in that identification, for example has room, Sala1, sala2, I pick up all the lines and do not want.
I want to pick up the digits before the colon (:) and then 1 and 4
I’m using this code:
the variable CL contains:
'Room' on the first line
'Sala1' on the second line
'Sala2' on the third line
declare -i TblStart=$(awk -F, "/$CL/ { print substr(\$0,48,10) }" /home/ficheiro.txt | cut -d ":" -f 1)
declare -i TblEnd=$(awk -F, "/$CL/ { print substr(\$0,48,10) }" /home/ficheiro.txt | cut -d ":" -f 2)
How to do?
What is the expected result?
– fedorqui