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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to use sed modify specific lines Jenny.palmy UNIX for Dummies Questions & Answers 5 05-18-2008 03:17 AM
How to read a specific column into variable victorcheung Shell Programming and Scripting 2 04-17-2008 10:49 PM
How to read a specific value from a Log file? cooolthud Shell Programming and Scripting 8 04-17-2008 08:30 AM
kernel:how to modify and read the tick rate:HZ amit4g Linux 0 01-08-2008 01:20 AM
read specific text from a log file ragha81 Shell Programming and Scripting 4 10-17-2006 10:17 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-17-2008
Registered User
 

Join Date: Apr 2008
Posts: 6
Stumble this Post!
Unhappy How to read a specific section and modify within

Hi, I am n00b to shell scripting and I am learning Ksh, sed and awk. I have a requirement and need your help.

1) How to read a specific section of a file. I have a file and I want to read the contents between say "Page Number:1" to "End of Page 1"
2) Within the section of the file that was read, I need to modify some values say "150" to "1500".

Please help.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-17-2008
Registered User
 

Join Date: Sep 2006
Location: Mysore, India
Posts: 155
Stumble this Post!
sed solution

Code:
sed '/Page Number:1/,/End of Page 1/ s/150/1500/g'  filename
Reply With Quote
  #3 (permalink)  
Old 04-17-2008
Registered User
 

Join Date: Apr 2008
Posts: 6
Stumble this Post!
Thumbs up

Thanks Kris!!! That worked.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:57 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0