06-21-2005
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?
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi,
I posted this over at Macnn and was redirected here... I'm not a unix programmer at all, but I have some backup if needed. Thanks in advance for any input.
Is there a command for the osX terminal that will list sequentially numbered groups of file as one line instead of individually,... (1 Reply)
Discussion started by: kentm
1 Replies
2. Shell Programming and Scripting
i have some 100's of files in the format .tar.gz. how to uncompress them in a single shot
i have sorted the files according to current date and now they reside in a dir called naveed1.
cd naveed1
ls -ltr
file1.tar.gz
file2.tar.gz
:
:
:
file100.tar.gz
how to uncompresse them in... (8 Replies)
Discussion started by: ali560045
8 Replies
3. Shell Programming and Scripting
i have some 350 files in a dir: i want to remove them in one shot,
ls -ltr | grep 'Sep 15' | head -350
the above command gives me those 350 files i need to remove them,how to implement remove logic here in this command?
i can get those 350 files using the above command only and therefore... (6 Replies)
Discussion started by: ali560045
6 Replies
4. Shell Programming and Scripting
I need to find all the files that have group Read or Write permission or files that have user write permission.
This is what I have so far:
find . -exec ls -l {} \; | awk '/-...rw..w./ {print $1 " " $3 " " $4 " " $9}'
It shows me all files where group read = true, group write = true... (5 Replies)
Discussion started by: shunter63
5 Replies
5. Shell Programming and Scripting
Hi,
I have a master file that i need to split into multiple files based on matched patterns. sample of my data as follows:-
scaff_1 a e 123 130 c_scaff_100
scaff_1 a e 132 138 c_scaff_101
scaff_1 a e 140 150 ... (2 Replies)
Discussion started by: redse171
2 Replies
6. Shell Programming and Scripting
Hi I have 4 files in a folder and I am supposed to group and zip them via a mapping file as such:
Group. Filename
1. A.txt
1. B.txt
2. C.txt
2. D.txt
Result should be 2 zip files - 1.zip and 2.zip created with the contents being the text file.
How can... (7 Replies)
Discussion started by: nightrider
7 Replies
7. UNIX for Dummies Questions & Answers
Hi
Is there an easy was to list a group of file (*.txt) and report how much disk space they are using in total?
Cheers (2 Replies)
Discussion started by: Grueben
2 Replies
8. UNIX for Dummies Questions & Answers
How to Tar group of Files on Sun OS? (2 Replies)
Discussion started by: Siva Sankar
2 Replies
9. AIX
Dears
it is normal that the below binaries stay without any owner and group
I have checked it in many servers and the like the below
/usr/lpp/bos.net/inst_root/etc/ipsec# ls -lrt
total 248
-r-xr-xr-x 1 987 987 13589 Jun 29 2005 default_group
-r-xr-xr-x ... (5 Replies)
Discussion started by: thecobra151
5 Replies
10. UNIX for Beginners Questions & Answers
I have two directories of files (new-config-files and old-config-files):
new-config-files/this-db/config.inc.php
new-config-files/that-db/config.inc.php
new-config-files/old-db/config.inc.php
new-config-files/new-db/config.inc.php
new-config-files/random-database/config.inc.php
etc.
... (4 Replies)
Discussion started by: spacegoose
4 Replies