The UNIX and Linux Forums  

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
to find header in Mp3 file and retrieve data shashi High Level Programming 2 09-12-2008 04:03 AM
How to extract data from a huge file? srsahu75 Shell Programming and Scripting 5 01-18-2008 05:06 AM
search and grab data from a huge file ting123 UNIX for Dummies Questions & Answers 1 06-06-2006 10:41 PM
sed, insert data from a file to another? ctcuser Shell Programming and Scripting 4 05-03-2005 02:43 PM
Insert a line as the first line into a very huge file shriek UNIX for Advanced & Expert Users 3 03-09-2005 01:22 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 02-10-2009
deepaktanna deepaktanna is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 4
Question insert a header in a huge data file without using an intermediate file

I have a file with data extracted, and need to insert a header with a constant string, say: H|PayerDataExtract

if i use sed, i have to redirect the output to a seperate file like

sed ' sed commands' ExtractDataFile.dat > ExtractDataFileWithHeader.dat

the same is true for awk

and in its simplist form i could say
echo 'H|PayerDataExtract' > ExtractDataFileWithHeader.dat
cat ExtractDataFile.dat >> ExtractDataFileWithHeader.dat
mv ExtractDataFileWithHeader.dat ExtractDataFile.dat

but in all of the above an extra file is created. If i were to do this in vi manually the extra file could be avoided.

Is there a way to avoid the extra file while still not having to manually use vi in a interactive manner? This is even more neccessary if the file uses over 50% filespace and an extra file will just double my usage , though temporarily
 

Bookmarks

Tags
non-interactive vi

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 12:44 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