awesome.... I am making progress.  I used ".bak" instead of ' ' b/c I do 
not want to remove the file after $ ^ I the edit is done.
BUT, 

I do not want to replace the E strings with the eject string instead I 
want to put the eject string in from of the E string and write now it is 
replacing ?

thanks!

Derek B. Smith
OhioHealth IT
UNIX / TSM / EDM Teams






"JupiterHost.Net" <[EMAIL PROTECTED]>
05/26/2004 03:12 PM

 
        To:     [EMAIL PROTECTED]
        cc:     "John W. Krahn" <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
        Subject:        Re: entering text within a file




[EMAIL PROTECTED] wrote:

> ok does this s/^(?=E\d{5})/eject\t0,0,0\t\n/ while <>;
> say...
> 
> from the beginning of the line match 0 or 1 E's with any digits then 
print 

?=E is sort of odd, I think you mean E?
so it is substituting the first part with the second part



s/^E?\d{5}/eject\t0,0,0\t\n/

will take a part of string like E12345 or 12345 and change it to 
eject\t0,0,0\t\n (only once and with an upper case E)

then you need a print statement to print anything.

while(<>) {
  s/^E?\d{5}/eject\t0,0,0\t\n/;
  print;
}

> the eject string?  I am not following the { 5 }. 
> my E string is 6 characters long, so why the 5?

\d{5} says five digits

> isn't there a insert regular expression?
HTH

Lee.M - JupiterHost.Net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to