Help with simple script

Discussion in 'Perl Misc' started by laser4000, Oct 7, 2005.

  1. laser4000

    laser4000 Guest

    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.
    laser4000, Oct 7, 2005
    #1
    1. Advertising

  2. laser4000

    Anno Siegel Guest

    laser4000 <-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.
    Anno Siegel, Oct 7, 2005
    #2
    1. Advertising

  3. 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/clpmisc/clpmisc_guidelines.html

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Hjalmarsson, Oct 7, 2005
    #3
  4. A. Sinan Unur, Oct 7, 2005
    #4
  5. 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
    Gunnar Hjalmarsson, Oct 7, 2005
    #5
  6. Gunnar Hjalmarsson <> 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 <>
    (reverse each component and remove .invalid for email address)

    comp.lang.perl.misc guidelines on the WWW:
    http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
    A. Sinan Unur, Oct 7, 2005
    #6
  7. -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?
    Arndt Jonasson, Oct 7, 2005
    #7
  8. laser4000

    Guest

    >>> 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!
    , Oct 7, 2005
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. geoffbache
    Replies:
    5
    Views:
    902
    geoffbache
    Jun 13, 2008
  2. Rajat
    Replies:
    3
    Views:
    688
    Jorgen Grahn
    Jan 8, 2010
  3. VYAS ASHISH M-NTB837
    Replies:
    2
    Views:
    550
    Jan Kaliszewski
    Jan 7, 2010
  4. dillon
    Replies:
    1
    Views:
    173
    higabe
    Nov 17, 2003
  5. Wladimir Borsov
    Replies:
    4
    Views:
    295
    Tintin
    May 11, 2006
Loading...

Share This Page