Link to home
Start Free TrialLog in
Avatar of Harrris
HarrrisFlag for Cyprus

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,
SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial