Harrris
asked on
Linux script to extract value from text file
Hello,
I have text files that contain something like:
<word1> <word2> <word3> <word4> ..... ID: <VALUE> <word20> <word21> <word22> ...
and I need a command/bash script that reads the file, gets the value after the "ID:" word and save it in a variable. The number of words and their value is different in each file. However, in all files the value I want to get is next to the ID: word (separated with space).
Anyone can help?
Thanks,
I have text files that contain something like:
<word1> <word2> <word3> <word4> ..... ID: <VALUE> <word20> <word21> <word22> ...
and I need a command/bash script that reads the file, gets the value after the "ID:" word and save it in a variable. The number of words and their value is different in each file. However, in all files the value I want to get is next to the ID: word (separated with space).
Anyone can help?
Thanks,
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.