473,324 Members | 2,257 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

translate this send into perl

How will I do this in perl?
print 1 line of context before and after regexp, with line number
# indicating where the regexp occurred (similar to "grep -A1 -B1")
sed -n -e '/regexp/{=;x;1!p;g;$!N;p;D;}' -e h

Thanks
Sundaram

Jul 19 '05 #1
1 2520
Red
sf******@gmail.com wrote:
How will I do this in perl?

print 1 line of context before and after regexp, with line number
# indicating where the regexp occurred (similar to "grep -A1 -B1")
sed -n -e '/regexp/{=;x;1!p;g;$!N;p;D;}' -e h


See the documentation for s2p: perldoc s2p
I think this will do what you want.

Regards,
Rob.
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: GreyWyvern | last post by:
Hello all! I'm in need of an algorithm to change windows-874 (Thai) encoding to UTF-8, without using PHPs iconv or similar functions. I've done the requisite googling and searching through the...
4
by: inquirydog | last post by:
Hello- I, the inquirydog, would like to solicit suggestions for a new web page I am making: I am creating a simple website that will translate concepts between windows os's, Linux, and the...
1
by: shank | last post by:
I'm sure this is a stretch, but is there some kind of component that I could install to translate from English to Spanish on the fly? I have a lot of equipment features and specifications that I...
6
by: calfliu | last post by:
hello: everybody! I have a simple question. How can I translate the selected value from art to recipient(hidden input button)? <form name="send" method="post" action="send.cgi"> <select...
13
by: Richard H | last post by:
Hi, I am building a site for a client which has an enquiry form on it. Normally I would something like PHP to send the form but the client doesn't want to pay for a server that supports PHP, so...
2
by: lqs | last post by:
hi£¡ i am writing a program using Socket . There is a class , for example: public class Student { public int nAge; public string strFirstName; public string strLastName; }
2
by: Amy L | last post by:
It looks as if there is no equivalent .Net regular expression method that is comparable to tr/// (Translate) in Perl. I was looking to squash a specific duplicate character in a string. In...
6
by: Paulchen | last post by:
Hello, I have found a perl script and need to "translate" this to PHP. I try to do it step by step and the first part of it is this function (the whole script is found at...
10
by: laredotornado | last post by:
Hi, I have certain blocks of Spanish text, for example ¿Necesita agregar una impresora o copiadora adicional a su forma personalizada de orden? Presione aquí. Don't know if the backwards...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.