in reply to Re^3: Split string variable of log input and output pieces in text file
in thread Split string variable of log input and output pieces in text file

Hi Marshall if I have a log now that I want the separators [] to be consumed, do I need to change the limiters? Or just modify the code like so:

 split /[[]\s:()]+/,$line>
  • Comment on Re^4: Split string variable of log input and output pieces in text file
  • Download Code

Replies are listed 'Best First'.
Re^5: Split string variable of log input and output pieces in text file
by AnomalousMonk (Archbishop) on Apr 23, 2016 at 16:10 UTC
    split /[[]\s:()]+/,$line>

    Have you tried to use the quoted code? What happens if you do? (I'm not sure what the  '>' on the end of this code fragment is supposed to be.)

    I'm not familiar with your data, but I think I would try (untested)
        split /[\[\]\s:()]+/, $line
    instead. Be aware that this may generate an extraneous empty string at the beginning of the split output list, so your selection indices may need adjustment.


    Give a man a fish:  <%-{-{-{-<