Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Prese Question: skipping spaces?

 [1/5] from: tmoeller:fastmail:fm at: 29-Aug-2008 14:42


Hi, i want to parse files with lines from an application log. The files contain lines where the columns are separated by spaces. My problem now is that i just wanted to see only specific columns. But, if the content of one column is longer, there are less spaces to the next column. When i use >a: parse/all line " "< and get the part a/22 it is not necessarily always the 5th column depending on the number of spaces between the columns. Sample: ["0x0B22E2A0" "0" "" "" "" "" "" "" "" "" "39" "" "" "" "" "" SYSBUFFERPOOLS "" "" "" "" "SYSIBM" "" "" "9" "" "" "" "" "" "" "" "" "Perm" "" "" "" "" "0" "" "" "" "" "" "" "" "" "" "1" "" "" "" "" "" "" "" "" "4" "" "" "" "" "" "" "" "" "" "0" "" "" "" "" "" "" "" "" "0" "" "" "" "" "" "" "" "" "" "0" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "0" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "0" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "0" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "0" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "0" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "0" "" "" "" "" "" "" "" "" "" "0" "" "" "" "" "" "" "" "" "" "0" "" "" "" "" "" "" "" ""] ["0x0DBCB6A0" "0" "" "" "" "" "" "" "" "" "40" "" "" "" "" "" SYSBUFFERPOOLNODES "SYSIBM" "" "" "0" "" "" "" "" "" "" "" "" "" Perm "" "" "" "" "0" "" "" "" "" "" "" "" "" "" "1" "" "" "" "" "" "" "" "" "" "3" "" "" "" "" "" "" "" "" "" "0" "" "" "" "" "" "" "" "" "" "0" "" "" "" "" "" "" "" "" "" "0" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "0" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "0" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "0" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "0" "" "" "" "" "" "" "" "" "" "" "" "" "" " 0" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "0" "" "" "" "" "" "" "" "" "" "0" "" "" "" "" "" "" "" "" "" "0" "" "" "" "" "" "" ""] Is there a way to avoid this problem or to work around??? Cheers Thorsten -- http://www.fastmail.fm - Or how I learned to stop worrying and love email again

 [2/5] from: sqlab:gmx at: 29-Aug-2008 15:00


Hi, did you try
>a: parse line none
? I am just assuming that the sample down is the result of parse. If not, just show some examples. AR Thorsten Moeller wrote:

 [3/5] from: tmoeller:fastmail:fm at: 29-Aug-2008 15:10


Hi, your assumption was correct and your suggestion did the job. Thanks a lot! Thorsten On Fri, 29 Aug 2008 15:00:59 +0200, "sqlab" <sqlab-gmx.net> said:
> Hi, > did you try
<<quoted lines omitted: 56>>
> To unsubscribe from the list, just send an email to > lists at rebol.com with unsubscribe as the subject.
-- http://www.fastmail.fm - Access your email from home and the web

 [4/5] from: jonwhispa::googlemail::com at: 29-Aug-2008 14:15


Hi line: "0x0B22E2A0 0 39 " a: Parse line ""
>> a/1
== "0x0B22E2A0"
>> a/2
== "0"
>> a/3
== "39" would be my first guess, maybe your logfile is more complex. Jon

 [5/5] from: henrikmk::gmail::com at: 29-Aug-2008 14:50


On Fri, Aug 29, 2008 at 2:42 PM, Thorsten Moeller <tmoeller-fastmail.fm> wrote:
> Hi, > i want to parse files with lines from an application log.
<<quoted lines omitted: 5>>
> necessarily always the 5th column depending on the number of spaces > between the columns.
Possibly trim/lines on each line before parsing it. That will remove extra spaces and allow you to parse on each single space.
>> trim/lines "a b"
== "a b" -- Regards, Henrik Mikael Kristensen

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted