« Previous Next »

Thread: Query issues with Null field value in TSV format...

Last post 09-25-2008 6:05 AM by yesubabu. 2 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (3 items)

Sort Posts:

  • 09-25-2008, 3:48 AM

    • yesubabu
    • Not Ranked
    • Joined on 09-25-2008, 3:19 AM
    • Posts 4

    Query issues with Null field value in TSV format...

    Hello:

    I have an issue in querying TSV format data files with some fields having nulls (no-data). The issue here is that logparser is considering the subsequent field value for the current field and messing up the data format.

    Please verify the query, sampledata and output pasted below to see the problem. Can anyone help with the workaround or fix to this issue?

    Appreciate your help!

    Regards,
    Yesu

    Query: logparser -i:tsv -o:tsv -q:on "select a,b,c,d from c:\sampledata.txt"

    SampleData:

    A B C D
    1 2 3 4
    11 13 14
    21 22 23 24
    31 34
    41 42 43 44

    Output:

    A B C D
    1 2 3 4
    11 13 14
    21 22 23 24
    31 34
    41 42 43 44

     

  • 09-25-2008, 4:53 AM In reply to

    • yellowdog.dave
    • Top 75 Contributor
    • Joined on 07-18-2008, 7:17 AM
    • Johannesburg, South Africa
    • Posts 84

    Re: Query issues with Null field value in TSV format...

    Hi Yesu, 

    The value in nsep (default 1) is assumed to be the minimum number of separators. To get around this use the fixedSep option. 

    Hope this helps. 

    Cheers, Dave 

    fixedSep
      Values: ON | OFF
      Default: OFF
      Description: Specifies whether or not the fields in the input TSV file(s) are separated by a fixed number of separator characters.
      Details: When this parameter is set to "ON", the TSV input format assumes that the number of separator characters between the fields in the input data equals exactly the value specified for the "nSep" parameter. In this case, the presence of more separator characters signifies an empty value, which is returned as a NULL value.
    When this parameter is set to "OFF", the TSV input format assumes that the fields in the input data are separated by a variable number of separator characters, and the value of the "nSep" parameter is assumed to be the minimum number of separator characters signifying a field separator. In this case, additional separator characters are ignored and parsed as a single field separator, thus making it impossible for a value to be interpreted as a NULL value.

     

    Yes, dear
  • 09-25-2008, 6:05 AM In reply to

    • yesubabu
    • Not Ranked
    • Joined on 09-25-2008, 3:19 AM
    • Posts 4

    Re: Query issues with Null field value in TSV format...

    Hi Dave,

    That worked. Thank you somuch for your help!

    Regards,

    Yesu 

     

     

Page 1 of 1 (3 items)
Microsoft Communities