Loading ...
Sorry, an error occurred while loading the content.

Re: [NH] newbie Perl scripting

Expand Messages
  • Piotr Bienkowski
    ... Hi Ron, Here s an example with the print command (and a few others). If the e- mail program collapsed the lines together, then each line should end right
    Message 1 of 5 , Oct 16, 2001
    • 0 Attachment
      On 16 Oct 2001, at 10:47, Ron Woodall wrote:

      > Hi Alec:
      >
      > Thanks for the tip. I've tried the print instruction but
      > nothing
      > happens. I guess I'll have to go back to the drawing board and try to
      > figure this out again.
      >

      Hi Ron,

      Here's an example with the print command (and a few others). If the e-
      mail program collapsed the lines together, then each line should end
      right after the ; character. The following script splits each line on
      the tab character, and then prints out field 4 and 6 (the first field
      being field zero) of each line.

      while (<>) {
      chomp($_);
      @a = split('\t',$_);
      print "$a[4]\t$a[6]\n";
      }

      HTH

      Piotr
    • Ron Woodall
      Hi Piotr: Hey - it works! Dam - ain t technology great? But then, without technology I wouldn t have had the problem in the first place ;-) Thanks for the help
      Message 2 of 5 , Oct 17, 2001
      • 0 Attachment
        Hi Piotr:

        Hey - it works! Dam - ain't technology great? But then, without
        technology I wouldn't have had the problem in the first place ;-)

        Thanks for the help and the info.

        Ron Woodall


        At 07:33 AM 10/17/01 +0200, you wrote:
        >On 16 Oct 2001, at 10:47, Ron Woodall wrote:
        >
        > > Hi Alec:
        > >
        > > Thanks for the tip. I've tried the print instruction but
        > > nothing
        > > happens. I guess I'll have to go back to the drawing board and try to
        > > figure this out again.
        > >
        >
        >Hi Ron,
        >
        >Here's an example with the print command (and a few others). If the e-
        >mail program collapsed the lines together, then each line should end
        >right after the ; character. The following script splits each line on
        >the tab character, and then prints out field 4 and 6 (the first field
        >being field zero) of each line.
        >
        >while (<>) {
        >chomp($_);
        >@a = split('\t',$_);
        >print "$a[4]\t$a[6]\n";
        >}
        >
        >HTH
        >
        >Piotr
        >
        >
        >
        >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
        >

        ---------------------------------------
        Ron Woodall
        nor@...

        The Compendium of HTML Elements
        "your essential web publishing resource"

        - available at/disponible à:
        http://au.htmlcompendium.org/index.htm (Australia)
        http://www.htmlcompendium.org/index.htm (Europe and North America)
      • Piotr Bienkowski
        ... Glad it worked for you. Perl is a very hairy language, but is well worth making friends with... Regards, Piotr
        Message 3 of 5 , Oct 17, 2001
        • 0 Attachment
          On 17 Oct 2001, at 11:45, Ron Woodall wrote:

          > Hi Piotr:
          >
          > Hey - it works! Dam - ain't technology great? But then,
          > without
          > technology I wouldn't have had the problem in the first place ;-)
          >
          > Thanks for the help and the info.

          Glad it worked for you. Perl is a very "hairy" language, but is well
          worth making friends with...


          Regards,

          Piotr
        Your message has been successfully submitted and would be delivered to recipients shortly.