cat asdf.txt bla-bla bla-bla bla[XYZ] importantthing another important thing [/XYZ] bla-bla bla-bla [XYZ] yet another thing hello! [/XYZ] bla-bla etc. $ SOMEPERLMAGIC asdf.txt > output.txt $ cat output.txt importantthing another important thing yet another thing hello!
how can i sovle this question? what is SOMEPERLMAGIC? are there any perl gurus, that have a little spare time?
Thank you! :\
You haven't asked a question. Also, this is not a perl mailing list. You keep sending messages asking how to do things instead of doing your own research. We are not Google, but I hear if you actually use Google and do things for yourself once and a while you will magicaly get answers.
Connected by MOTOBLUR™ on T-Mobile
-----Original message----- From: S Mathias smathias1972@yahoo.com To: users@lists.fedoraproject.org Sent: Tue, Jan 4, 2011 04:27:35 CST Subject: a perl question
cat asdf.txt bla-bla bla-bla bla[XYZ] importantthing another important thing [/XYZ] bla-bla bla-bla [XYZ] yet another thing hello! [/XYZ] bla-bla etc. $ SOMEPERLMAGIC asdf.txt > output.txt $ cat output.txt importantthing another important thing yet another thing hello!
how can i sovle this question? what is SOMEPERLMAGIC? are there any perl gurus, that have a little spare time?
Thank you! :\
On 01/04/2011 11:27 AM, S Mathias wrote:
cat asdf.txt bla-bla bla-bla bla[XYZ] importantthing another important thing [/XYZ] bla-bla bla-bla [XYZ] yet another thing hello! [/XYZ] bla-bla etc. $ SOMEPERLMAGIC asdf.txt > output.txt $ cat output.txt importantthing another important thing yet another thing hello!
how can i sovle this question? what is SOMEPERLMAGIC? are there any perl gurus, that have a little spare time?
Thank you! :\
Hi,
suppose the input data are saved in the file x. Then this little command line could help:
perl -e 'while (<>) {/thing|hello/ && print}'<x
resp. create an executable file thing.pl with 2 lines
#!/usr/bin/perl while (<>) {/thing|hello/ && print}
and call
thing.pl <x or cat x|./thing.pl
This is you needed?
Kind regards
On Tue, 04 Jan 2011 12:05:29 +0100, Joachim wrote:
On 01/04/2011 11:27 AM, S Mathias wrote:
cat asdf.txt bla-bla bla-bla bla[XYZ] importantthing another important thing [/XYZ] bla-bla bla-bla [XYZ] yet another thing hello! [/XYZ] bla-bla etc. $ SOMEPERLMAGIC asdf.txt > output.txt $ cat output.txt importantthing another important thing yet another thing hello!
how can i sovle this question? what is SOMEPERLMAGIC? are there any perl gurus, that have a little spare time?
Thank you! :\
Hi,
suppose the input data are saved in the file x. Then this little command line could help:
perl -e 'while (<>) {/thing|hello/ && print}'<x
resp. create an executable file thing.pl with 2 lines
#!/usr/bin/perl while (<>) {/thing|hello/ && print}
and call
thing.pl <x or cat x|./thing.pl
This is you needed?
Very likely not. As I understand it, he wants a Perl script to filter out arbitrary text between the opening and closing tags [XYZ] … [/XYZ]. It doesn't need a Perl "guru" to program something like that, but it's a little bit of an exercize for somebody who wants to start programming in Perl.
On 4 January 2011 10:27, S Mathias smathias1972@yahoo.com wrote:
cat asdf.txt bla-bla bla-bla bla[XYZ] importantthing another important thing [/XYZ] bla-bla bla-bla [XYZ] yet another thing hello! [/XYZ] bla-bla etc. $ SOMEPERLMAGIC asdf.txt > output.txt $ cat output.txt importantthing another important thing yet another thing hello!
how can i sovle this question? what is SOMEPERLMAGIC? are there any perl gurus, that have a little spare time?
It looks like you need something a bit like this.
#!/usr/bin/perl
use strict; use warnings;
while (<>) { if (m|[XYZ]| .. m|[/XYZ]|) { next if m|[/?XYZ]|; print; } }
But I can't be sure as you haven't actually explained what you question is.
For Perl questions, you might be better advised to try Stack Overflow or your local Perl Mongers group.
Dave...
On 01/04/2011 04:27 AM, S Mathias wrote:
cat asdf.txt bla-bla bla-bla bla[XYZ] importantthing another important thing [/XYZ] bla-bla bla-bla [XYZ] yet another thing hello! [/XYZ] bla-bla etc. $ SOMEPERLMAGIC asdf.txt> output.txt $ cat output.txt importantthing another important thing yet another thing hello!
how can i sovle this question? what is SOMEPERLMAGIC? are there any perl gurus, that have a little spare time?
Seriously, Mathias. These look like questions straight out of entry level university classes. Are you asking mailing lists to do your homework for you?
Not cool at all.
TC
On 4 January 2011 14:27, Thomas Cameron thomas.cameron@camerontech.comwrote:
Seriously, Mathias. These look like questions straight out of entry level university classes. Are you asking mailing lists to do your homework for you?
Not cool at all.
Especially as your supervisor may well be lurking on lists to see who is trying to get other people to do their assignments!
jch