Sponsored Content
Full Discussion: group by in files :-)
Top Forums UNIX for Dummies Questions & Answers group by in files :-) Post 75673 by hellsd on Tuesday 21st of June 2005 11:10:38 AM
Old 06-21-2005
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 ?
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

listing sequential files as one group...

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

uncompress a group of files

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

need help in remove group of files

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

Find all files with group read OR group write OR user write permission

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

How to group matched patterns in different files

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

Group files and zip

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

Space utilization for group of files

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

How to Tar group of Files on Sun OS? (2 Replies)
Discussion started by: Siva Sankar
2 Replies

9. AIX

Files without owner and group

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

Replace Stub Values In One Group Of Files With Actual Values From Another Group Of Files

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
GSHADOW(5)						   File Formats and Conversions 						GSHADOW(5)

NAME
gshadow - shadowed group file DESCRIPTION
/etc/gshadow contains the shadowed information for group accounts. This file must not be readable by regular users if password security is to be maintained. Each line of this file contains the following colon-separated fields: group name It must be a valid group name, which exist on the system. encrypted password Refer to crypt(3) for details on how this string is interpreted. If the password field contains some string that is not a valid result of crypt(3), for instance ! or *, users will not be able to use a unix password to access the group (but group members do not need the password). The password is used when an user who is not a member of the group wants to gain the permissions of this group (see newgrp(1)). This field may be empty, in which case only the group members can gain the group permissions. A password field which starts with a exclamation mark means that the password is locked. The remaining characters on the line represent the password field before the password was locked. This password supersedes any password specified in /etc/group. administrators It must be a comma-separated list of user names. Administrators can change the password or the members of the group. Administrators also have the same permissions as the members (see below). members It must be a comma-separated list of user names. Members can access the group without being prompted for a password. You should use the same list of users as in /etc/group. FILES
/etc/group Group account information. /etc/gshadow Secure group account information. SEE ALSO
gpasswd(5), group(5), grpck(8), grpconv(8), newgrp(1). shadow-utils 4.1.5.1 05/25/2012 GSHADOW(5)
All times are GMT -4. The time now is 09:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy