Customer Portal

Need simple example with quotedStrings

Comments 5

  • Avatar
    slechtaj
    0
    Comment actions Permalink
    Hi Eric,

    A similar issue has been reported in earlier versions. What version do you use?
  • Avatar
    ericl
    0
    Comment actions Permalink
    I'm using version 3.3.1.

    Am I doing it correctly by using the quotedStrings attribute at the "Record" level in the fmt file ?

    Any alternative to make this work would be greatly appreciated!

    Thank you!

    Eric
  • Avatar
    slechtaj
    0
    Comment actions Permalink
    Hi Eric,

    DataParsing.java does not use any external FMT file. The metadata are created inside the code. Due to a logic in the code, it is not possible to set qutedStrings in the java file, since this would be ignored.
    However, you may sligthly modify the code. All you need to do is to replace parser
    Parser parser = TextParserFactory.getParser(metadata);

    with the following code:
     final TextParserConfiguration parserCfg = new TextParserConfiguration();
    parserCfg.setMetadata(metadata);
    parserCfg.setCharset("UTF8");
    parserCfg.setVerbose(true);
    parserCfg.setTreatMultipleDelimitersAsOne(false);
    parserCfg.setQuotedStrings(metadata.isQuotedStrings());
    parserCfg.setQuoteChar(metadata.getQuoteChar());
    parserCfg.setSkipLeadingBlanks(false);
    parserCfg.setSkipTrailingBlanks(false);
    parserCfg.setTryToMatchLongerDelimiter(DataRecordUtils.containsPrefixDelimiters(parserCfg.getMetadata()));
    parserCfg.setTrim(null);
    Parser parser = TextParserFactory.getParser(parserCfg);


    Besides this, you will also need to adjust the metadata accordingly to your data source.

    Please note that you should be working on component level (create your own graphs) instead of pareser level.
  • Avatar
    ericl
    0
    Comment actions Permalink
    Thank you very much Jan, that solved my problem!

    I will read more on processing the data at the component level, any simple example you could suggest (GraphSort.java maybe) ?

    Thanks again,

    Eric
  • Avatar
    slechtaj
    0
    Comment actions Permalink
    Hi Eric,

    Yes, this is correct, GraphSort.java is the file you may use. There is also another example (XMLGraph.java), which is used to run the graph from XML definition.

Please sign in to leave a comment.