CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions:
Parsing Issue

 



krishna_sicsr
New User

Aug 18, 2009, 10:04 PM

Post #1 of 4 (2904 views)
Parsing Issue Can't Post

Hi Below is my output of one my command I have to parse the last value Allocated speed that is "-- --". I am not able to parse this value and store in one array to validate further. Please help me in this paring.

======================================
Port Network Name Status PXE MAC Address Allocated
Speed
======================================
1 n1 OK UseBIOS <Factory-Default> -- --
2 n1 OK UseBIOS <Factory-Default> -- --
3 n1 OK UseBIOS <Factory-Default> -- --

Thanks, Krishna


spider
User


Aug 18, 2009, 11:45 PM

Post #2 of 4 (2901 views)
Re: [krishna_sicsr] Parsing Issue [In reply to] Can't Post

What have you tried? Show us some code.

What can you tell us about the input values?
How does the values look like when they are not -- --?
What about the other values? Are the MAC Address always in < >? If not how is the syntax when there are a adress spesified? Seperated by colon?
Can there be a space in any of the other values?


krishna_sicsr
New User

Aug 19, 2009, 12:03 AM

Post #3 of 4 (2899 views)
Re: [spider] Parsing Issue [In reply to] Can't Post

Thanks I am done with this parsing my code is

$RET = "NEW ITEM -- --
OLD ITEM -- --";
@myarray = ($RET =~ /(--\s--)/g);
foreach $x1 (@myarray)
{
print"\n $x1";
}


spider
User


Aug 19, 2009, 1:04 AM

Post #4 of 4 (2895 views)
Re: [krishna_sicsr] Parsing Issue [In reply to] Can't Post

So you did not wan't to get any speed, just the "-- --"?
If you want the excact string "-- --", why don't you just say:
print "-- --" ;

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives