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

Re: [PBML] Fw: Alternate code required.

Expand Messages
  • Nathan.Jeffrey@dhs.vic.gov.au
    Yeah, sorry about that :-) It should read.... perl -ne m/^( w+) s+RBIErr :( w+) :RBIErr/ ; print $2 n
    Message 1 of 3 , Jul 29, 2002
    • 0 Attachment
      Yeah, sorry about that :-)

      It should read....

      perl -ne 'm/^(\w+)\s+RBIErr\:(\w+)\:RBIErr/ ; print "$2\n"' < file
      ^
      extra slash

      That's what I get for giving advice without testing :-)

      N






      Subodh <subodh.gupta@...>
      29/07/2002 05:39 PM
      Please respond to perl-beginner


      To: perl-beginner@yahoogroups.com
      cc: Nathan.Jeffrey@...
      Subject: Re: [PBML] Fw: Alternate code required.


      Hi Jeffrey,

      the code gives an error..

      Search pattern not terminated at -e line 1.

      Subodh Gupta

      Quoting Nathan.Jeffrey@...:

      > Subodh,
      >
      > Id probably do it like this (in Perl)...
      >
      > perl -ne m/^(\w+)\s+RBIErr\:(\w+)\:RBIErr ; print "$2\n" < file
      >
      > The patterns probably longer than it needs to be, but that way you can
      >
      > get to the first string via $1, and the second string via $2. Of
      > course,
      > \w will match word characters, so you might need to change that
      > depending on what youre expecting to see.
      >
      > Good luck!
      >
      > Nathan
      >
      >
      >
      >
      >
      >
      > Greg Webster <greg@...>
      > 28/07/2002 04:23 AM
      > Please respond to perl-beginner
      >
      >
      > To: perl-beginner@yahoogroups.com
      > cc:
      > Subject: [PBML] Fw: Alternate code required.
      >
      >
      >
      > Folks, please check that you are sending directly to the list, not to
      > the
      > owner of the list.
      >
      > Greg
      >
      > Begin forwarded message:
      >
      > Date: Sat, 27 Jul 2002 06:30:36 -0000
      > From: "subodhonline" <subodh.gupta@...
      > >
      > To: perl-beginner-owner@yahoogroups.com
      > Subject: Alternate code required.
      >
      > Hi All,
      >
      > This must be a piece of cake for u people, but for me its difficult
      > since
      > Ihardly know shell scripting. I have a which contains lines which look
      > like this..
      >
      > somecharacters1 RBIErr:somemorecharacters1:RBIErr
      > somecharacters1 RBIErr:somemorecharacters2:RBIErr
      > somecharacters1 RBIErr:somemorecharacters3:RBIErr
      > somecharacters1 RBIErr:somemorecharacters4:RBIErr
      > somecharacters1 RBIErr:somemorecharacters5:RBIErr
      > somecharacters1 RBIErr:somemorecharacters6:RBIErr
      > .......
      >
      > now I want to generate a new file which has the output like this...
      >
      > somemorecharacters1
      > somemorecharacters2
      > somemorecharacters3
      > somemorecharacters4
      > somemorecharacters5
      > somemorecharacters6
      >
      > How can I do this? I have done it with using awk.. like this... but I
      > want
      > to know other ways ofdoing this which might be fool proof
      >
      > mycode:
      >
      > grep somechar.*RBIErr: $inputfile |
      > awk BEGIN{ ; FS="RBIErr:" }
      > { printf $2; printf "\n"; }
      > END{ ;}|
      > awk BEGIN{ ; FS=":RBIErr" }
      > { printf $1; printf "\n"; }
      > END{ ;} > $newfilename
      >
      > Thanks in advance.
      > Subodh Gupta.
      >
      >
      >
      >
      > Unsubscribing info is here:
      > http://help.yahoo.com/help/us/groups/groups-32.html
      >
      > Your use of Yahoo! Groups is subject to
      > http://docs.yahoo.com/info/terms/
      >
      >
      >
      >
      >
      >
      >
      >
      _________________________________________________________________________________
      >
      > This email contains confidential information intended only for the
      > person named above and may be subject to legal privilege. If you are not
      > the intended recipient, any disclosure, copying or use of this
      > information is prohibited. The Department provides no guarantee that
      > this communication is free of virus or that it has not been intercepted
      > or interfered with. If you have received this email in error or have any
      > other concerns regarding its transmission, please notify
      > Postmaster@...
      >
      _________________________________________________________________________________
      >
      >
      > ------------------------ Yahoo! Groups Sponsor
      >
      > Unsubscribing info is here:
      > http://help.yahoo.com/help/us/groups/groups-32.html
      >
      > Your use of Yahoo! Groups is subject to
      > http://docs.yahoo.com/info/terms/
      >
      >
      >

      -------------------------------------------------
      Sify Mail - now with Anti-virus protection powered by Trend Micro, USA.
      Know more at http://mail.sify.com

      One click here and you could be counting money!
      StreetsCall from Walletwatch.com. Subscribe now!
      http://www.walletwatch.com/cgi-bin/ww/walletwatch/equity/news_articles/news_detail.jsp?oid=11658894


      Unsubscribing info is here:
      http://help.yahoo.com/help/us/groups/groups-32.html

      Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    Your message has been successfully submitted and would be delivered to recipients shortly.