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
Combine a datafile with Master datafile, emergent! onthetopo Shell Programming and Scripting 6 05-12-2007 07:36 AM
Append filename to datafile Satyagiri UNIX for Dummies Questions & Answers 3 10-12-2006 10:19 AM
selective positions from a datafile ganapati Shell Programming and Scripting 10 09-19-2006 10:09 AM
oracle datafile *dbf tt155 SUN Solaris 3 12-17-2005 07:38 PM
New Section kapilv Post Here to Contact Site Administrators and Moderators 3 10-31-2001 09:57 PM

 
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 06-13-2005
Paprika Paprika is offline
Registered User
  
 

Join Date: Jun 2005
Posts: 2
Cool replace a paragraph in a textfile

Hi:
First, this is not a homework problem. I just need enough of a hint to get this going...
My datafile (dataf.in) is made up of 10 sections. Each section begins with & and with &&
So it looks like this:-------------------------------------
&section1
...etc...
&&

&section2
...etc...
&&

------------------

I need to replace section2 with a new section that I call "section_new" contained
in file (dataf.new). So now, dataf.in looks like this now:
&section1
...etc...
&&

&section_new
...etc...
&&


I am trying to do that with no luck with a shell script or awk.
Is that feasible? or should I be coding it in C?
Any suggestion or feedback is appreciated.

Best,
Paprika

Last edited by Paprika; 06-14-2005 at 10:54 AM.. Reason: want to include additional comment.
 

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 11:26 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