Help with simple script

L

laser4000

I need a simple perl script that read in a txt file.
and if it find a text wich I fill in a varialble it must print OK to
dstout.
 
A

Anno Siegel

laser4000 said:
I need a simple perl script that read in a txt file.
and if it find a text wich I fill in a varialble it must print OK to
dstout.

You don't want help with your script, you want it written for you.
That's not what we do here. Make an effort of your own. If you have
problems, show what you have and we may help you correct it.

Anno
 
G

Gunnar Hjalmarsson

laser4000 said:
I need a simple perl script that read in a txt file.
and if it find a text wich I fill in a varialble it must print OK to
dstout.

Thanks for letting us know about your needs.

Would you mind showing us the code you have written so far, and letting
us know which difficulties you encountered?

If you post again, please follow the posting guidelines for this group:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
 
A

Arndt Jonasson

I need a simple perl script that read in a txt file.
and if it find a text wich I fill in a varialble it must print OK to
dstout.

Consider putting more effort into expressing what it is you want.
People will probably not write the code for you anyway, but it's good
practice (and I don't mean good English practice, but it is that
too). How is that variable to be "filled", for example?
 
U

usenet

laser4000 said:
I need a simple perl script that read in a txt file.
and if it find a text wich I fill in a varialble it must print OK to
dstout.

You can do that in Perl. But you must first FTP the text file to an
intermediate site in Belgum. Then you cobble together LWP and IO:All
to create a virtual FTP filesystem to access the file (because that's
the only way that Perl can access files). You must then convert the
file to UniCode and then to binary (you must go through unicode first
to avoid seven or eight bit binary character representations). Then
convert your search string to Unicode and then to binary (you can't
search binary unicode with an ASCII search term, you know). Then open
the file and check if your pattern matches the first X bits (where X is
the length of your search term). If it does not, shift the file one bit
to the left and test again. Keep doing this until it either matches or
you reach EOF.

This is the usual manner of parsing files in Perl. You ought to be
able to do it in only a few dozen lines of code.

Cheers!
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top