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.  FTP file - Problem with semicolon and quotes when importing file

    Employee
    Posted 03-15-2016 01:28

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

    Originally posted by: laurrieta

    I'm getting a file through FTP Get node (working fine). Problem is with the data as fields are enclosed in quotes and delimited by a semicolon (sanple in Source Data.txt). I've tried with a Delimited File and a CSV File nodes, but in both cases results are not the expected ones (screenshots attached, columns are not broken).

    Field Delimiter
    node:56e67e281b2a1ec3
    type:binary
    name:Delimited+File
    inputut1=56e2978421d71830.out1
    outputut1
    prop:ls.brain.graphElement.color=<<EOX
    FFA800
    EOX
    prop:ls.brain.node.convert.fileNameExpr=<<EOX
    ;line:1
    'Filename'
    EOX
    prop:ls.brain.node.convert.columnDelimiter=;\n
    prop:ls.brain.node.convert.recordDelimiter=;\r\n
    prop:ls.brain.node.convert.columnNames=a;b;dummy
    prop:binary=nodeInputDelimited
    end:56e67e281b2a1ec3

    CSV File
    node:56e690be46cd488a
    type:binary
    name:CSV+File
    input:downloaded files=56e186a02ecf429f.downloaded files
    outputut1
    prop:ls.brain.node.convert.columnDelimiter=,
    prop:ls.brain.node.convert.quoteCharacters="
    prop:ls.brain.node.convert.recordDelimiter=\n
    prop:ls.brain.graphElement.color=<<EOX
    FFA800
    EOX
    prop:ls.brain.node.convert.fileNameExpr=<<EOX
    ;line:1
    '_DestinationFile'
    EOX
    prop:ls.brain.node.convert.columnNames=a;b;dummy
    prop:binary=nodeInputDelimited
    end:56e690be46cd488a



    I'll appreciate your helps to sort it out
    Attachments:
    Field Delimiter Output.bmp
    CSV Output.bmp


  • 2.  RE: FTP file - Problem with semicolon and quotes when importing file

    Employee
    Posted 03-15-2016 07:31

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

    Originally posted by: ryeh

    Is the format always the same? If so, it may be easiest to use the SPLIT function and extract the first two items.

    node:Filter
    bretype:core::Filter
    editor:sortkey=56e81d966e6c7402
    input:@40fd2c74167f1ca2/=Static_Data.40fe6c55598828e5
    output:@40fd2c7420761db6/=
    prop:Script=<<EOX
    _tmp = Data.replace("\"","").split(";")
    a = _tmp[0]
    b = _tmp[1]
    
    emit *, a,b
    
    EOX
    editor:XY=370,500
    end:Filter
    
    node:Static_Data
    bretype:core::Static Data
    editor:sortkey=56e81a6605a5274f
    output:@40fe6c55598828e5/=
    prop:StaticData=<<EOX
    Data
    \"001\";"29022016";
    \"002\";"29022016";
    \"003\";"29022016";
    \"004\";"29022016";
    EOX
    editor:XY=270,500
    end:Static_Data