Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Help with simple script

Reply
Thread Tools

Help with simple script

 
 
laser4000
Guest
Posts: n/a
 
      10-07-2005
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.

 
Reply With Quote
 
 
 
 
Anno Siegel
Guest
Posts: n/a
 
      10-07-2005
laser4000 <(E-Mail Removed)-spam.invalid> wrote in comp.lang.perl.misc:
> 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
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
 
Reply With Quote
 
 
 
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      10-07-2005
laser4000 wrote:
> 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/cl...uidelines.html

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 
Reply With Quote
 
A. Sinan Unur
Guest
Posts: n/a
 
      10-07-2005
http://www.velocityreviews.com/forums/(E-Mail Removed)-spam.invalid (laser4000) wrote in news:43464c85$0
$59303$(E-Mail Removed):

> 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.


Perl is not really the right language for this. Consider using Ruby.

http://www.ruby-lang.org/en/



--
A. Sinan Unur <(E-Mail Removed)>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/cl...uidelines.html
 
Reply With Quote
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      10-07-2005
A. Sinan Unur wrote:
> Perl is not really the right language for this. Consider using Ruby.


Please don't nudge it so it returns!

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 
Reply With Quote
 
A. Sinan Unur
Guest
Posts: n/a
 
      10-07-2005
Gunnar Hjalmarsson <(E-Mail Removed)> wrote in news:3qn4m9FfgkgnU1
@individual.net:

> A. Sinan Unur wrote:
>> Perl is not really the right language for this. ....

>
> Please don't nudge it so it returns!


You are right. I should know better.

Sinan

--
A. Sinan Unur <(E-Mail Removed)>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/cl...uidelines.html
 
Reply With Quote
 
Arndt Jonasson
Guest
Posts: n/a
 
      10-07-2005

(E-Mail Removed)-spam.invalid (laser4000) writes:
> 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?
 
Reply With Quote
 
usenet@DavidFilmer.com
Guest
Posts: n/a
 
      10-07-2005
>>> laser4000 wrote:
> 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!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute a script from another script and other script does notdo busy wait. Rajat Python 3 01-08-2010 02:05 PM
RE: How to execute a script from another script and other script doesnotdo busy wait. VYAS ASHISH M-NTB837 Python 2 01-07-2010 08:18 PM
Converting a simple python script to a simple windows executable geoffbache Python 5 06-13-2008 08:51 PM
How to call a simple perl script from HTML without need of HTTPS but simple HTTP ? Wladimir Borsov Perl Misc 4 05-11-2006 09:29 AM
Simple problem with a simple chat script dillon Javascript 1 11-17-2003 11:11 PM



Advertisments