Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] sorting data set -Help
- Date: Wed, 6 Dec 2006 13:26:22 +0900
- From: "Keith Bawden" <keith@example.com>
- Subject: Re: [tlug] sorting data set -Help
- References: <586d0f820612051907i4d8086f0ycab3b060afa8d84d@example.com>
On 12/6/06, John Joseph <johnjoseph.e@example.com> wrote:I am a new linux user. Would like to sort the data set by selecting rows containing different set of first few letters or words. Example of data set is given below. Wondering how do I select and write those rows statrting with "$TKACC"; "$TKGPP" and "$TKATT". My data file is quite large size. ============================================== $TKATT,-0307P, 0051R,284.2T,00*27 $TKACC, 1551600, -28.8966, -84.0000,04C6,057E,2945*43 $TKGPP,011547.00,3529.377014,N,13547.150285,E,2,08,1.1,8.885,M,,M,4,0672,1*52
# SNIP
I'm not sure if I have entirely understood your question, but here goes...
Do you want one file with the data sorted by the contents of the first column or do you want three separates files?
If you want one large file then my previous post will be the way to go. If you want three seperate files this may be what you are looking for:
cat original_data.txt | grep '^\$TKACC' | sort > TKACC_data.txt cat original_data.txt | grep '^\$TKATT' | sort > TKATT_data.txt cat original_data.txt | grep '^\$TKGPP' | sort > TKGPP_data.txt
Check the man page for sort for any special sorting requirements you may have.
Regards, Keith
- Follow-Ups:
- Re: [tlug] sorting data set -Help
- From: Keith Bawden
- References:
- [tlug] sorting data set -Help
- From: John Joseph
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Getting back into C programming
- Next by Date: Re: [tlug] sorting data set -Help
- Previous by thread: [tlug] sorting data set -Help
- Next by thread: Re: [tlug] sorting data set -Help
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links