Unix, AWK Pululaaraa... help Chalanachithram.com | Topics | Search
Hide Clipart | Log Out | Register | Edit Profile

Last 30 mins | 1 | 2 | 4 hours     Last 1 | 7 Days

Chalanachithram.com DB » TF Industry related » Archive through January 31, 2013 » Unix, AWK Pululaaraa... help « Previous Next »

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

Feldgrau
Junior Artist
Username: Feldgrau

Post Number: 406
Registered: 12-2012
Posted From: 76.185.166.13

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, January 31, 2013 - 09:28 am:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

hmmm awk kanna perl easy, since u need a counter
Top of pagePrevious messageNext messageBottom of page Link to this message

Ideal_brain
Junior Artist
Username: Ideal_brain

Post Number: 56
Registered: 03-2008
Posted From: 198.228.200.49

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, January 31, 2013 - 08:37 am:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

You need a sequence number associated to the name? If so you need to sort the output using name and then do the sed.
Top of pagePrevious messageNext messageBottom of page Link to this message

Maverick
Legend
Username: Maverick

Post Number: 43055
Registered: 01-2008
Posted From: 98.214.82.0

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, January 31, 2013 - 04:54 am:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)


Platypus:




sed "s/\s/:/g" <infile.txt> outfile.txt
Who is this DB member?
Top of pagePrevious messageNext messageBottom of page Link to this message

Platypus
Comedian
Username: Platypus

Post Number: 1239
Registered: 01-2008
Posted From: 122.169.130.117

Rating: N/A
Votes: 0 (Vote!)

Posted on Thursday, January 31, 2013 - 04:32 am:   Insert Quote Edit PostDelete PostPrint Post   Move Post (Moderator/Admin Only)Ban Poster IP (Moderator/Admin only)

I have a file: something.txt

Contents:

venu 124 220
venu 120 234
charlie 231 433
charlie 234 455

I need the following output

venu:1:124:220
venu:2:120:234
charlie:1:231:433
charlie:2:234:455

Quick help please. I am an absolute beginner in AWK.
Naaku nacchindi janaalaki nacchadu... Janaalaki nacchindi naaku nacchadu... Nenanthe.. adho type.

Add Your Message Here
Post:
Bold text Italics Underline Create a hyperlink Insert a clipart image HASH(0x87e2d44){Movie Clipart}
Show / hide regular icons selection options

Click on following links to open cliparts by Alphabetical Order

 A   B   C   D   E   F   G   H   I   J   K   L   M  

 N   O   P   Q   R   S   T   U   V   W   X   Y   Z  

Show / Hide Filmy icons selection options

Click on following links to open cliparts by Alphabetical Order

 A   B   C   D   E   F   G   H   I   J   K   L   M  

 N   O   P   Q   R   S   T   U   V   W   X   Y   Z  

Username: Posting Information:
This is a public posting area. Enter your username and password if you have an account. Otherwise, enter your full name as your username and leave the password blank. Your e-mail address is optional.
Password:
E-mail:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: