Forum Discussion

emiliocb4_27077's avatar
Icon for Nimbostratus rankNimbostratus
May 11, 2011

scan problem

hi all,



follow is a part of my irule



set valore "*gtw1"


scan $valore %s%s primo secondo


log local0.debug " primo= $primo secondo= $secondo"



set valore1 "* gtw1"


scan $valore1 %s%s terzo quarto


log local0.debug " terzo= $terzo quarto= $quarto"



the first one doesn't work, the secondo one works.



how can i set as separator?



i tried to use ^ or or "^" or "" but none works





can u help me??


1 Reply

  • Hi Emilio,



    The problem is that everything but a space (or other whitespace) will be matched with %s:





    So you'd need to be able to specify a character class that doesn't include the in order to use scan for the first string. If you just want to split the string on a specific character you can use getfield or split instead:






    If neither of those options work, can you give more detail on what you're trying to parse? The more examples, the better.