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
delete files recursively in the specified directory deepthi.s Shell Programming and Scripting 3 08-13-2008 10:03 PM
delete files older than 5 minutes in directory (recursively) scarfake Shell Programming and Scripting 3 06-13-2008 01:10 AM
replacing strings with text from other file mc1392 Shell Programming and Scripting 1 03-24-2008 03:46 PM
Delete strings in a file ayhanne Shell Programming and Scripting 8 11-09-2007 09:48 AM
extracting a set of strings from a text file Deanne Shell Programming and Scripting 2 09-20-2007 11:31 PM

Closed Thread
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 12-29-2008
santosh1234 santosh1234 is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 16
recursively delete the text between 2 strings from a file

i have 200000bytes size of a unix file i need to delete some text between two strings recursively using a loop with sed or awk . these two strings are : 1st string getting from a file :::2 nd string is fi...its constant . can anyone help me sed -n'/<1 st string >/,/fi/' <input_filename> is the command i want to use ....
  #2 (permalink)  
Old 12-29-2008
JASI JASI is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 7
Could you post a couple of lines of the file as an example?
  #3 (permalink)  
Old 12-29-2008
santosh1234 santosh1234 is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 16
using below code

for i in `cat <first_string_used_file>`
do
sed -n '/$i/,/fi/' <input_file> >> lbl_file
done
Closed Thread

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