LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 07-14-2005, 09:22 PM   #16
Matir
Moderator
 
Registered: Nov 2004
Location: Kennesaw, GA
Distribution: Ubuntu
Posts: 8,502

Rep: Reputation: 110Reputation: 110
Re: Awk solution


Quote:
Originally posted by vladmihaisima
And here is an awk solution:

Code:
 awk -- " /foo$/ {p=1;}; /bar$/ {e=1;}; /.*/ { if(p==1) {print \"somethingelse\nsecond row\"; b=1; p=0; }; if(b!=1) { print; }; if(e==1) { e=0; b=0; }}; "
Not as clear as sed though, but that comment about tells me maybe I don't like very much sed for a good reason. I admit that the above command is not very clear, but for someone used with flex, it's not that bad.(and it does what one might expect )
It gives you a headache?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and replace text in multiple file Bad_Bob Linux - Software 9 05-08-2008 02:31 AM
Replace text of unknown content with other text in file brian0918 Linux - Software 1 07-14-2005 03:22 PM
How to replace a string in a text file jpan Linux - General 2 01-11-2005 06:02 PM
replace a string/number in a text file jpan Linux - General 3 10-22-2004 09:33 PM
best method to replace data in a text file? gsbarry Linux - General 5 04-15-2003 08:21 AM


All times are GMT -5. The time now is 05:13 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration