Re: Parsing This Line

new topic     » goto parent     » topic index » view thread      » older message » newer message
include std/sequence.e 
include std/console.e 
 
 
sequence line = """company=Billy's Operating Company&profile=Dori&user=Dori Setchell&form=aaplepca&inv=N/A&pc_id=1554165672&lic_path=C:\Documents and Settings\BillyRay\Application Data\Microsoft\Templates&win=Windows XP Professional&word=Word 2010"""  
 
 
 
procedure get_field( sequence line, sequence lookfor ) 
    line  = split( line, '&' ) 
 
    for i=1 to length(line) do 
        line[i] = split( line[i], '=' ) 
        if match( lookfor, line[i][1] ) then 
            puts(1, line[i][2] ) 
            exit 
        end if 
    end for 
 
end procedure 
 
 
get_field( line, "company" ) 

Billy's Operating Company

The fancy stuff I leave to you... _tom

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu