LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Importing Text File with quotation delimiter

    Employee
    Posted 07-15-2011 09:45

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: phudson

    Hi,

    I am a newbie to brain and I am having some difficulty importing a text file into a delimiter node which has quotation as delimiter.

    Parameter 1:
    FieldDelimiter = "
    RecordDelimiter = \n

    Headers are in quotes as well. Can anyone help?

    Error log:
    ERROR processing data:
    6 errors found while validating output field names.

    Installing log (07/15/2011 10:24:31) ...
    2011-07-15 10:24:31; Level: 2; Type: 0; Desc: "Field 1 on output has a zero-length or all whitespace name."; File: "\src\brain_d\ra_dev\code\source\tableio\Delimited TableOutput.cpp"; Line: 108; Context: ""
    2011-07-15 10:24:31; Level: 2; Type: 0; Desc: "Field 3 on output has a zero-length or all whitespace name."; File: "\src\brain_d\ra_dev\code\source\tableio\Delimited TableOutput.cpp"; Line: 108; Context: ""
    2011-07-15 10:24:31; Level: 2; Type: 0; Desc: "Field 5 on output has a zero-length or all whitespace name."; File: "\src\brain_d\ra_dev\code\source\tableio\Delimited TableOutput.cpp"; Line: 108; Context: ""
    2011-07-15 10:24:31; Level: 2; Type: 0; Desc: "Field 7 on output has a zero-length or all whitespace name."; File: "\src\brain_d\ra_dev\code\source\tableio\Delimited TableOutput.cpp"; Line: 108; Context: ""
    2011-07-15 10:24:31; Level: 2; Type: 0; Desc: "Field 9 on output has a zero-length or all whitespace name."; File: "\src\brain_d\ra_dev\code\source\tableio\Delimited TableOutput.cpp"; Line: 108; Context: ""
    2011-07-15 10:24:31; Level: 2; Type: 0; Desc: "Field 11 on output has a zero-length or all whitespace name."; File: "\src\brain_d\ra_dev\code\source\tableio\Delimited TableOutput.cpp"; Line: 108; Context: ""
    2011-07-15 10:24:31; Level: 2; Type: 0; Desc: "6 errors found while validating output field names."; File: "\src\brain_d\ra_dev\code\source\tableio\Delimited TableOutput.cpp"; Line: 113; Context: ""
    Uninstalling log (07/15/2011 10:24:31) ...


  • 2.  RE: Importing Text File with quotation delimiter

    Employee
    Posted 07-15-2011 10:23

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: stonysmith

    Are there empty fields at the end of the record?

    something like this:
    "A","B",,,,,,,
    will cause trouble.

    It would help if you could include the first two records of the file here in the forum thread.


  • 3.  RE: Importing Text File with quotation delimiter

    Employee
    Posted 07-15-2011 13:55

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: phudson

    Here are the first few records:

    "accountid" "switch_account_call_count" "switch_account_duration" "bill_account_call_count" "bill_account_duration"
    "2020166" "2" "58" "17" "733"
    "2025881" "13" "762" "179" "19366"
    "2025976" "9" "729" "175" "20188"
    "2031018" "37" "1392" "455" "33645"
    "2031271" "1" "21" "24" "1317"


  • 4.  RE: Importing Text File with quotation delimiter

    Employee
    Posted 07-15-2011 14:31

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: timonk

    Hi There,

    when I copy/paste what you posted into a text editor, it comes up formatted with a tab value between the columns. Is that just an artifact of webpage or are you actually tab delimited?

    Regards,
    Timon Koufopoulos
    MDA Support.


  • 5.  RE: Importing Text File with quotation delimiter

    Employee
    Posted 07-15-2011 14:52

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: phudson

    This txt file is acutally the results of an audit that was done by MDA tech. I checked and it is set as a tab delimiter \t. I did this and it works but the quotation remains.

    I have attached a sample of the file.
    Attachments:
    Audit_5_6_count_nonmatch.txt


  • 6.  RE: Importing Text File with quotation delimiter

    Employee
    Posted 07-16-2011 17:01

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: timonk

    If it is tab delimited, then what you are looking for is \t in the fieldDelimiter value, and the double quote " character in the QuoteCharacters parameter, and you should be all set.

    Regards,
    Timon Koufopoulos
    MDA Support


    node:Delimited_File
    bretype:core::Delimited File
    editor:sortkey=4e20a98a41a555a2
    output:@41e6c6cd11e613c6/=
    prop:FieldDelimiter=\t
    prop:File=C:\temp\TESTDATA.txt
    prop:QuoteCharacters="
    prop:QuotedDoubleQuotes=Literal Quote
    prop:RecordDelimiter=\n
    editor:XY=760,140
    end:Delimited_File


  • 7.  RE: Importing Text File with quotation delimiter

    Employee
    Posted 07-18-2011 13:22

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: phudson

    Works Perfectly!

    Thanks...


  • 8.  RE: Importing Text File with quotation delimiter

    Employee
    Posted 10-21-2011 11:26

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: burke

    The above solution works well until you have a garbage delimited file that contains the QuoteCharacters in the data too, which is something I recently ran into.
    example
     "tams2011031447730532"  "Big 10" Aerosmith"       "4.0"   "Rock"
    The solution in my case was to leave QuoteCharacters blank and use a Trim node to trim the characters from either end of the data, this also resulted in the field names having to be renamed - however it worked non the less.