I have a file with the following lines of text:
jeremy , thomas , 123
peter , paul , 456
jack , jill , 789
I would like to remove all of the data except for the center item. For example ending up with a file which contains:
thomas
paul
jill
I have tried so many awk patterns my brain is exploding. Any help would be appreciated.
Try awk
:
awk -F '[[:space:]]*,[[:space:]]*' '{print $2}' input.txt
Try this
cat <filepath> | tr -d ' ' | cut -d',' -f2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With