I have a file test.txt
, which contains the following result:
service_name1= apple/ball/cat/dog/egg/12.34.56/ball/apple
service_name2= fan/girl/house/ice/joker/23.45.67/fan/girl
and so on up to service_name1500
I want output like :
egg 12.34.56
joker 23.45.67
and so on: the version number along with the word before that.
Best Answer
This should be a simple
cut
job:-d/
sets the input delimiter as/
-f5,6
outputs only the 5th and 6th field--output-delimiter=" "
sets the output delimiter as a spaceSame thing with
awk
,awk
by default sets the output field separator as space:Example: