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

Fw: [PBML] How can i take one column of one string?

Expand Messages
  • Robert Brown
    Sorry - I meant to enclose $strg in single quotes - not double quotes as % would be interpreted as a hash. ... From: Robert Brown To:
    Message 1 of 1 , Dec 11, 2006
    • 0 Attachment
      Sorry - I meant to enclose $strg in single quotes - not double quotes as % would be interpreted as a hash.


      ----- Forwarded Message ----
      From: Robert Brown <rdabman4@...>
      To: perl-beginner@yahoogroups.com
      Sent: Monday, December 11, 2006 1:49:32 PM
      Subject: Re: [PBML] How can i take one column of one string?


      One possible answer

      my ($strg,$pct)="";
      my @flds=();
      $strg="/dev/dsk/cotodos6 1370511 96072 1219619 8% /export/home";
      @flds=split(" ",$strg);
      $pct=$flds[4]; # arrays start from zero
      print "Fifth column field is $pct\n";


      ----- Original Message ----
      From: Marcos Onisto <mlonisto@...>
      To: perl-beginner@yahoogroups.com
      Sent: Monday, December 11, 2006 1:29:31 PM
      Subject: [PBML] How can i take one column of one string?

      Hello All,

      I have one string that follow below. How can i take the 8% or exactly 5 column?

      /dev/dsk/c0t0d0s6 1370511 96072 1219619 8% /export/home

      I really appreciate some help.

      Thanks a lot,

      Marcos

      ------------ --------- --------- ---
      Check out the all-new Yahoo! Mail beta - Fire up a more powerful email and get things done faster.

      [Non-text portions of this message have been removed]








      Need a quick answer? Get one in minutes from people who know. Ask your question on Yahoo! Answers.

      __________________________________________________
      Do You Yahoo!?
      Tired of spam? Yahoo! Mail has the best spam protection around
      http://mail.yahoo.com

      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.