Search the web
Sign In
New User? Sign Up
geeksthatgawk · for GNU Awk questions & discussions
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
creating a new file from old one using awk   Message List  
Reply | Forward Message #214 of 221 |
i have the following file;

12345,89
78777,89
56789,40
18978,40
98864,40
21378,41

i want to create a different file like this;

ACCTS WITH CODE 89
12345
78777
NUMBER OF ACCTS WITH CODE 89: 2
ACCTS WITH CODE 40
56789
18978
98864
NUMBER OF ACCTS WITH CODE 40: 3
ACCTS WITH CODE 41
21378
NUMBER OF ACCTS WITH CODE 41: 1

how can i do this please?
thanks

http://www.mtnonline.com/contact/disclaimer.asp


[Non-text portions of this message have been removed]






Thu Sep 21, 2006 5:47 pm

gnuts4lunch
Offline Offline
Send Email Send Email

Forward
Message #214 of 221 |
Expand Messages Author Sort by Date

i have the following file; 12345,89 78777,89 56789,40 18978,40 98864,40 21378,41 i want to create a different file like this; ACCTS WITH CODE 89 12345 78777 ...
Femi George [ MTN - G...
gnuts4lunch
Offline Send Email
Sep 22, 2006
12:41 am

Read the file with Gawk a line at a time. Set comma as the field separator. On each line, look at the second field. If it is an account number that you haven't...
Albert Bickford
albert_bickford
Offline Send Email
Sep 22, 2006
1:37 am

The algorithm below works best if the file is already pre-sorted based on the Account Code, so using gawk win32 and gsort win32... assume test.txt contains: ...
Ambrosio Berdijo
aberdijo
Offline Send Email
Sep 22, 2006
2:00 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help