The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #7 (permalink)  
Old 06-21-2005
hellsd hellsd is offline
Registered User
 

Join Date: Nov 2004
Posts: 20
Now it is more complicate:

Lets say the input file is:
ABC^1^~^data^x
ABC^2^~^data^x
ABC^3^~^data^x
DEF^4^~^data^y
DEF^4^~^data^z
DEF^5^~^data^y
DEF^5^~^data^z
DEF^6^~^data^z
DEF^6^~^data^y
XYZ^7^~^data^t

Now I would like to group couple of fields(field 2 and field 5)
My output should be:

ABC^1,2,3^~^data^x
DEF^4,5,6^~^data^y,z
XYZ^7^~^data^t

Notice that I would like to print all the line's fields.

Is it possible?
Reply With Quote