Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > concatenating 2...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 2128 of 2371
Post > Topic >>

concatenating 2nd field if 1st field is same

by sixstringsin@[EMAIL PROTECTED] Jan 13, 2008 at 10:30 AM

I have a datafile:

data1:1,2,3,4
data2:434,434,233,7
data3:23,44,76,334
data4:4,6,55,8
data1:6,76,45,09
data5:45,43,343,2
data2:3,43,5,5656,5


I am using awk with input field separator as ":"

I want to concatenate field 2 of every record that has the same field
1.


The final contents of the processed file should look like:

data1:1,2,3,4,6,76,45,09
data2:434,434,233,7,3,43,5,5656,5
data3:23,44,76,334
data4:4,6,55,8
data5:45,43,343,2


Any guidance is highly appreciated.
 




 5 Posts in Topic:
concatenating 2nd field if 1st field is same
sixstringsin@[EMAIL PROTE  2008-01-13 10:30:56 
Re: concatenating 2nd field if 1st field is same
Janis Papanagnou <Jani  2008-01-13 19:46:51 
Re: concatenating 2nd field if 1st field is same
pop <p_o_p@[EMAIL PROT  2008-01-13 12:54:54 
Re: concatenating 2nd field if 1st field is same
sixstringsin@[EMAIL PROTE  2008-01-13 12:34:59 
Re: concatenating 2nd field if 1st field is same
sixstringsin@[EMAIL PROTE  2008-01-13 12:49:38 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 7 12:28:27 CDT 2008.