I have a data file (file.txt) contains the below lines:
123 pro=tegs, ETA=12:00, team=xyz,user1=tom,dom=dby.com 345 pro=rbs, team=abc,user1=chan,dom=sbc.int,ETA=23:00 456 team=efg, pro=bvy,ETA=22:00,dom=sss.co.uk,user2=lis I'm expecting to get the first column ($1) only if the ETA= number is greater than 15, like here I will have 2nd and 3rd line first column only is expected.
345 456 I tried like cat file.txt | awk -F [,TPF=]' '{print $1}' but its print whole line which has ETA at the end.
[,TPF=]as field separator, and this string does not occur anywhere in your file. Therefore the first field equals the whole line. BTW, the command you posted has an unbalanced single quote, so it would not even execute.[,TPF=]in that context isn't a string, it's a bracket expression containing 5 characters, so the record would be split into fields at everyT,=, etc.print $1could print the whole line?'before[,TPF=]') so it can't print anything. idk what the script was that printed a whole line for the OP but if you fixed the syntax error, that script wouldn't do that, it'd print up to the first=from the line shown in the example.