[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Text processing
- From: Dan Track <dan track gmail com>
- To: For users of Fedora Core releases <fedora-list redhat com>
- Subject: Text processing
- Date: Fri, 3 Feb 2006 15:50:27 +0000
Hi
I've got the following output
Col1 Col2 Col3 Col5
1 000 001 Yes
2 000 001
3 000 001
4 Yes Yes
4 000 001
4 000 001
5 000 001
5 Yes 001
6 000 001 Yes
As you can see the column widths vary in size. What I need to do is to
find out The number in Col1 that is associated with all those "Yes"
occurrences in Col5. How can I do this.
I've tried the following
cat file | tr -s ' ' ' ' | tr -s '\t' ' ' | cut -d ' ' -f 6
But I get a result like this
Hi
I've got the following output
Col1 Col2 Col3 Col5
1 000 001 Yes
2 000 001
3 000 001
4 Yes Yes
4 000 001
4 000 001
5 000 001
5 Yes 001
6 000 001 Yes
As you can see one of the "Yes" statements has moved into the third
column, so that's a wrong move.
Any help would be appreciated
Thanks
Dan
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]