The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Formatting a line of data into columns nistleloy UNIX for Dummies Questions & Answers 3 05-12-2009 04:52 PM
writing data in a text file at particular line punitpa Shell Programming and Scripting 2 04-14-2009 01:45 PM
Reading data from a specific line in a text file jermaine4ever Shell Programming and Scripting 4 04-02-2009 04:21 AM
Reading data from a specific line in a text file jermaine4ever Shell Programming and Scripting 1 04-01-2009 06:08 AM
accessing o an exact line in a file walnut Shell Programming and Scripting 2 02-23-2006 04:31 PM

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

Join Date: Jun 2009
Posts: 74
Formatting a text file to get data in exact line by line

I have my data something like this
Code:
    SERIAL FIRSTOCCURRENCE
NETPROTOCOL
1947430693 07/01/2009 05:16:40
FR
 
    SERIAL FIRSTOCCURRENCE
NETPROTOCOL
1947430746 07/01/2009 05:18:05
FR
I want the output as follows.
Code:
SERIAL.......................FIRSTOCCURRENCE.........................NETPROTOCOL
1947430693...................07/01/2009 05:16:40.....................FR
SERIAL.......................FIRSTOCCURRENCE.........................NETPROTOCOL
1947430746...................07/01/2009 05:18:05.....................ATM
i kept .... just for understanding..I don't want that in my final output. I searched this forum for the solution. But didn't get the solution.
Any help will be much appreciated.
-Ravi
  #2 (permalink)  
Old 07-02-2009
cjcox cjcox is offline
Registered User
  
 

Join Date: May 2005
Posts: 64
Just some hints for now... the blank line is the trigger for record separation (as well as EOF). You can use awk. Collect up the data and when the trigger happens you can use printf in awk to format the output.

I'm just trying to get you to do the work, you'll learn more.

Does that help? (without me or someone writing the code for you)
Reply

Bookmarks

Tags
format, text, unix

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 01:23 PM.


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