r/techsupport•
xalx

Extracting data from text file to input to another text file

So what I have is a text file of attributes and a text file log which has these attributes and an action along side it

e.g. 10-19-attribute1: details of action 11-06-attribute2: details of action 10-19-attribute1: details of action

The list goes on for a while. So what I'm trying to do is extract each line pertaining to each attribute.

In Ubuntuu I've done grep "10-19-attribute1" /path/to/source > attribute1.txt

This works fine. But what I'd like to do is use the text file of attributes to (there are a lot) so I don't have to do this for each one individually.

Is this possible?

Posted Mar 25, 2012, 1:38 AM UTC

21
Loading comments…