If you need to identify and split into different sets, maybe you can create a temporary pattern file copy as
Code: Select all
sed -e 's/^/\^/' yourPatternFile > tempPatternFile
sed -e 's/^/ /' -e 's/$/ /' yourPatternFile >> tempPatternFile
sed -e 's/$/ /' yourPatternFile >> tempPatternFile
Code: Select all
egrep -f tempPatternFile yourSourceDataFile
Thus the line
will becomeThis is a test line
You can then do you pattern matching using lookup with the third column.1 Thisb This
1 bisb is
1 bab a
1 btestb test
1 bline line
where b is blank character
This way, you get the line number which relates to the row, the original data as it appears in the row and the trimmed data to match. This will give you all analysis.