The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Format problem of text file repinementer Shell Programming and Scripting 13 09-14-2009 04:38 AM
Changing the text file format kavithakuttyk Shell Programming and Scripting 3 06-11-2009 01:07 PM
Format a text file jhardy Shell Programming and Scripting 2 03-17-2009 02:32 PM
Conver Excel file to another format ( text) ZINGARO HP-UX 6 07-23-2008 02:52 PM
write data into a text file in bold format miltony UNIX for Dummies Questions & Answers 1 09-28-2005 08:21 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-27-2009
vino_hymi vino_hymi is offline
Registered User
  
 

Join Date: Oct 2009
Location: Bangalore,India
Posts: 12
Post Content format in a text file

Hi,

I need to format the content in a text file as below format. Can some one help me how to approach? Also whether is it possible to convert the output to excel in column wise?

Present:

Code:
=============================================================================
Name: vinodh
Status: active
dateofjoin: 2009/09/25 14:31:43;  course: csc
school of computing science
=============================================================================
Name: sam
Status: notactive
dateofjoin: 2009/09/25 14:31:43;  course: csc
school of computing science
=============================================================================
Name: John
Status: notactive
dateofjoin: 2009/09/25 14:31:43;  course: it
=============================================================================

Required:

Code:
Name: vinodh Status: active    dateofjoin: 2009/09/25 14:31:43; course: csc school of computing science
Name: sam    Status: notactive dateofjoin: 2009/09/25 14:31:43; course: csc school of computing science
Name: John   Status: notactive dateofjoin: 2009/09/25 14:31:43; course: it

Thanks
  #2 (permalink)  
Old 10-30-2009
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2007
Location: Germany
Posts: 2,323
Not very compact but works on your example:

Code:
awk '$1=$1' RS= infile| sed 's/ =\+ /\n/g; s/=\+ //g; s/ =\+//g'
Name: vinodh Status: active dateofjoin: 2009/09/25 14:31:43; course: csc school of computing science
Name: sam Status: notactive dateofjoin: 2009/09/25 14:31:43; course: csc school of computing science
Name: John Status: notactive dateofjoin: 2009/09/25 14:31:43; course: it

Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:05 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0