Results 1 to 2 of 2

Thread: Data from multiple inputs for a single item

Hybrid View

  1. #1
    Join Date
    Jun 2012
    Posts
    5

    Question Data from multiple inputs for a single item

    Hi all, I have a problem I haven't yet found a solution for.

    I have one object to be built from multiple files. For instance:

    Code:
    Class MyObject
      - Property MyPropertyA
      - Property MyPropertyB
      - Property MyPropertyC
      - Property MyPropertyD
    Now let's say I have three input files:

    Code:
    InputFileA.csv
    InputFileB.csv
    InputFileC.csv
    I would have to read lines from all three files to create MyObject, let's say as follows:

    Code:
    MyPropertyA : InputFileA (line 13, field 4)
    MyPropertyB : InputFileB (line 11, field 7)
    MyPropertyC : InputFileC (line 5, field 2)
    MyPropertyD : InputFileC (line 6, field 2)
    Each of the records in these files would have a common identifier to enable the relationship to be built, say an ID number in field 1 of each file.

    Is this possible with Spring or am I asking too much?


    Cheers,
    Jordan

  2. #2
    Join Date
    Feb 2012
    Posts
    6

    Default

    Hi Jordan,

    I am not a spring expert but i have worked a lot in plain java, and that looks a quite simple task to do in plain java without the need of a framework.

    If i wanted to use Spring for this maybe an option i think is that you could load those files to tables in a database and use Hibernate+Spring to simplify the coding.
    As csv files can be easily loaded into a database table from inside a java class or from outside (as you wish).

    Cheers,
    Martin.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •