some sed to perl action...

B

Barry Ringuet

eh gday, put together the following dog eviction but don't know how to
unravel it again... would like to do only in perl but don't know how
and am not digesting perlre fast enough
appreciated...
sed -n '/somestring/,$p' somefile|perl -pi -e
's/\f/\n/g,s/\033E//,s/\015//g' > somefile2
 
P

Paul Lalli

eh gday, put together the following dog eviction but don't know how to
unravel it again... would like to do only in perl but don't know how
and am not digesting perlre fast enough
appreciated...
sed -n '/somestring/,$p' somefile|perl -pi -e
's/\f/\n/g,s/\033E//,s/\015//g' > somefile2

Since not all of us speak sed, it might be a good idea to tell us in
English what you're trying to accomplish...

Paul Lalli
 
J

Jim Cochrane

Since not all of us speak sed, it might be a good idea to tell us in
English what you're trying to accomplish...

Paul Lalli

"sed -n '/somestring/,$p' somefile" simply looks for a match of
'somestring' in 'somefile' and, if there is one, prints from the first line
that matches to the end of the file.
 
T

Thens

On 8 Apr 2004 12:40:57 -0700
eh gday, put together the following dog eviction but don't know how to
unravel it again... would like to do only in perl but don't know how
and am not digesting perlre fast enough
appreciated...
sed -n '/somestring/,$p' somefile|perl -pi -e
's/\f/\n/g,s/\033E//,s/\015//g' > somefile2

$ man s2p

NAME
s2p - Sed to Perl translator

s2p might be of help to you.

Regards,
Thens.
 
G

Glenn Jackman

Barry Ringuet said:
eh gday, put together the following dog eviction but don't know how to
unravel it again... would like to do only in perl but don't know how
and am not digesting perlre fast enough
appreciated...
sed -n '/somestring/,$p' somefile|perl -pi -e
's/\f/\n/g,s/\033E//,s/\015//g' > somefile2

perl -ne '
$go=1 if not $go and /somestring/;
s/\f/\n/g, s/\033E//, s/\015//g, print if $go;
' somefile > somefile2
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,108
Latest member
AlbertEste
Top