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 > Special Forums > UNIX Desktop for Dummies Questions & Answers
.
google unix.com



UNIX Desktop for Dummies Questions & Answers Discuss UNIX and Linux user interfaces like GNOME, KDE, CDE, and Open Office here. All UNIX and Linux Newbies Welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script required to get a required info from file. Pls. help me. ntgobinath Shell Programming and Scripting 2 05-31-2008 09:34 AM
Formatting mirusnet Shell Programming and Scripting 3 01-06-2008 11:38 PM
Formatting using awk cdunavent Shell Programming and Scripting 2 03-18-2003 02:09 PM
formatting tamemi UNIX for Dummies Questions & Answers 5 07-21-2002 10:03 AM
formatting xeron UNIX for Dummies Questions & Answers 5 03-20-2002 11:33 AM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-05-2009
digipak digipak is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 19
Help required with formatting

I would appreciate any help (sed / awk / perl) on the following question. I have the file in the following format. Note that the records are separated by the line that starts with the word "TRACE".I want the 5th and 6th values on the line starting with "TRACE" to be repeated down the file until the next record is hit (a line starting with the word TRACE). If this is my input file, then please have a look at the bottom i.e the output that I want using perl or awk.

INPUT
=======
TRACE mrjn05 6487 4922 358666.00 3154690.00 4 8
4 12068.6
12 12067.9
20 12066.7
28 12065.6
36 12064.7
44 12063.4
52 12062.1
60 12061.3
68 12060.9
76 12060.6
84 12057.9
92 12052.7
100 12052.1
TRACE mrjn05 6487 4923 358685.00 3154680.00 4 8
4 12068.6
12 12068
20 12066.9
28 12065.8
36 12064.7
44 12063.5
52 12062.2


OUTPUT
=======

TRACE mrjn05 6487 4922 358666.00 3154690.00 4 8
4 12068.6 358666.00 3154690.00
12 12067.9 358666.00 3154690.00
20 12066.7 358666.00 3154690.00
28 12065.6 358666.00 3154690.00
36 12064.7 358666.00 3154690.00
44 12063.4 358666.00 3154690.00
52 12062.1 358666.00 3154690.00
60 12061.3 358666.00 3154690.00
68 12060.9 358666.00 3154690.00
76 12060.6 358666.00 3154690.00
84 12057.9 358666.00 3154690.00
92 12052.7 358666.00 3154690.00
TRACE mrjn05 6487 4923 358685.00 3154680.00 4 8
4 12068.6 358685.00 3154680.00
12 12068 358685.00 3154680.00
20 12066.9 358685.00 3154680.00
28 12065.8 358685.00 3154680.00
36 12064.7 358685.00 3154680.00
44 12063.5 358685.00 3154680.00
52 12062.2 358685.00 3154680.00

Any help on this will be higly appreciated. The file is really huge (about 800 MB) and I am just a beginer. Please help.

Last edited by digipak; 05-05-2009 at 07:15 AM.. Reason: bad formatting
 

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 05:29 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