2

I have different data files that are mapped on relational stores. I do have a formatter which contains the separators used by the different data files (most of them csv). Here is an example of how it looks like:

DQKI 435741198746445 45879645422727JHUFHGLOBAL COLLATERAL SERVICES AGGREGATOR V9

The rule to read this file is as following: from index 0 to 3, it's the code name, from index 8 to 11, it's PID, from index 11 to 20, it's account number, and so on...

How do you specify such rule in ActivePivot Relational Stores?

Andre Silva
  • 4,782
  • 9
  • 52
  • 65
Seif Eddine Mouelhi
  • 2,161
  • 3
  • 19
  • 25
  • I found this link. It helps to solve the issue. http://stackoverflow.com/questions/11212393/how-to-read-a-specific-position-of-a-string-data-in-a-text-file – Seif Eddine Mouelhi Aug 08 '13 at 22:49

1 Answers1

0

The relational-store of ActivePivot ships with a high performance, multithreaded CSV-Source to parse files and load them into data stores. I suppose that's what you hope to use for your fixed-length field file.

But this is not supported in the current version of the Relational Store (1.5.x).

  • You could pre-process your file with a small script to add a separator character at the end of each of the fields. Then the entire CSV Source can be reused immediately.
  • You could write your own data source that defines fields as offset in the text line. If you do that you can reuse all of the fast field parsers available in the CSV Source project (they work on any char sequences):

    com.quartetfs.fwk.format.impl.DoubleParser
    com.quartetfs.fwk.format.impl.FloatParser
    com.quartetfs.fwk.format.impl.DoubleVectorParser
    com.quartetfs.fwk.format.impl.FloatVectorParser
    com.quartetfs.fwk.format.impl.IntegerParser
    com.quartetfs.fwk.format.impl.IntegerVectorParser
    com.quartetfs.fwk.format.impl.LongParser
    com.quartetfs.fwk.format.impl.ShortParser
    com.quartetfs.fwk.format.impl.StringParser
    com.quartetfs.fwk.format.impl.DateParser
    
Antoine CHAMBILLE
  • 1,676
  • 2
  • 13
  • 29