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
How to use sed modify specific lines Jenny.palmy UNIX for Dummies Questions & Answers 5 05-18-2008 06:17 AM
How to read a specific column into variable victorcheung Shell Programming and Scripting 2 04-18-2008 01:49 AM
How to read a specific value from a Log file? cooolthud Shell Programming and Scripting 8 04-17-2008 11:30 AM
kernel:how to modify and read the tick rate:HZ amit4g Linux 0 01-08-2008 05:20 AM
read specific text from a log file ragha81 Shell Programming and Scripting 4 10-17-2006 01:17 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-17-2008
kn.naresh kn.naresh is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 7
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.
  #2 (permalink)  
Old 04-17-2008
krishmaths krishmaths is offline
Registered User
  
 

Join Date: Sep 2006
Location: Mysore, India
Posts: 191
sed solution

Code:
sed '/Page Number:1/,/End of Page 1/ s/150/1500/g'  filename
  #3 (permalink)  
Old 04-18-2008
kn.naresh kn.naresh is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 7
Thumbs up

Thanks Kris!!! That worked.
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 03:18 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