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
Best place on the net to get Perl tutorials ? Browser_ice Shell Programming and Scripting 1 08-10-2006 02:43 AM
Perl text file Sn33R Shell Programming and Scripting 5 10-31-2003 11:59 AM
Enter text and display on logo perleo Shell Programming and Scripting 1 06-26-2003 11:42 AM
Can i ask the question of perl in the place? ybz3721 High Level Programming 2 04-17-2002 05:13 AM
Update text files in place (string substitution) ?? kornshellmaven UNIX for Dummies Questions & Answers 1 07-17-2001 12:11 AM

 
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 03-20-2009
som.nitk som.nitk is offline
Registered User
  
 

Join Date: Nov 2008
Location: Pune, India
Posts: 23
Post Perl - Enter text in a file in a place.

Hi,
I have a simple question:

I need to enter some text in a text file at a certain place via perl.
I would first need to find that specific text in the file and then I would like to insert a line after that particular line.

Say I have this text file:

I am a great Perl Programmer

I would like to learn Perl





Now I would like to insert a line called: "My Name is Som" between the two lines.
So I would need a regex to search the line: "I am a great Perl Programmer" and then insert "My Name is Som" in the next line.
What should be the command in perl? I know this is a dumb question.
Can anyone help?
Thanks

Last edited by som.nitk; 03-20-2009 at 01:49 PM..
 

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 06:09 PM.


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