![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to listout the files based on group by the date...? | psiva_arul | UNIX for Dummies Questions & Answers | 3 | 04-21-2008 09:03 AM |
| Newly created files default group and write permissions | goldfish | UNIX for Dummies Questions & Answers | 2 | 02-20-2008 06:39 PM |
| Recursive search for group or other writeable 'dot' files | maficdan | Security | 5 | 02-14-2008 09:43 PM |
| Monkcast #12: IBM HW group OEMs Solaris to chagrin of SW group & a ... - ZDNet.com bl | iBot | UNIX and Linux RSS News | 0 | 08-17-2007 04:30 PM |
| listing sequential files as one group... | kentm | UNIX for Advanced & Expert Users | 1 | 01-24-2007 06:11 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
group by in files :-)
My file looks like:
X^~^12^d X^~^19^d Y^~^5^d Y^~^10^d Y^~^11^d Z^~^14^d I need a script that will "group by" the first field and Concatenate the values. My output should be: X^~^12,19^d Y^~^5,10,11^d Z^~^14~d Does anyone have any idea ? |
|
||||
|
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? |
| Sponsored Links | ||
|
|