LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-29-2012, 01:28 PM   #16
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918

http://www.linuxquestions.org/questi...1-line-717972/
Code:
[schneidz@hyper ~]$ cat micymw.txt
Device ID: SEP001121111111
IP address: 1.1.1.1
Platform: Cisco IP Phone 7970, Capabilities: Host Phone Two-port Mac Relay
Device ID: SEP00115C222222
IP address: 2.2.2.2
Platform: Cisco IP Phone 7940, Capabilities: Host Phone Two-port Mac Relay
Device ID: SEP000D29033333
IP address: 3.3.3.3
Platform: Cisco IP Phone 7960, Capabilities: Host Phone Two-port Mac Relay
[schneidz@hyper ~]$ awk 'ORS=(NR%3)?",":"\n"' micymw.txt 
Device ID: SEP001121111111,IP address: 1.1.1.1,Platform: Cisco IP Phone 7970, Capabilities: Host Phone Two-port Mac Relay
Device ID: SEP00115C222222,IP address: 2.2.2.2,Platform: Cisco IP Phone 7940, Capabilities: Host Phone Two-port Mac Relay
Device ID: SEP000D29033333,IP address: 3.3.3.3,Platform: Cisco IP Phone 7960, Capabilities: Host Phone Two-port Mac Relay
also, you have a comma on each platform line... not sure how you would like to handle.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] find a null value in a row/column and delete entire row umix Linux - Newbie 10 10-13-2011 01:26 AM
Transposing only part of row into column Mehidi Programming 1 07-08-2011 05:53 AM
[ask awk] remove certain row in a column dhodho Programming 18 06-08-2010 09:36 AM
transpose row to column? resolute155 Programming 3 09-07-2009 02:29 PM
Transposing a column into a row mayyash Linux - General 1 09-30-2005 02:23 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration