Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7043971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:21:14+00:00 2026-05-28T02:21:14+00:00

I am getting a file with data for multiple output tables with different number

  • 0

I am getting a file with data for multiple output tables with different number of columns.

The first column will decide the table where the record should go.

head1|abc|123|sklj|sad
head2|klj|lkj|323|323
tab1|one|two|three|four|five
tab2|one|two|three
tab2|one|two|three
tab3|one|two|three|four

As shown above, head specifies header. So first two lines are header records.

tab1 specifies table 1. which has five columns. So all records starting with tab1 should be loaded in table1.

tab2 specifies table 2. which has three columns. So all records starting with tab2 should be loaded in table2.

tab3 specifies table 3. which has four columns. So all records starting with tab3 should be loaded in table3.

How to achieve this scenario ?

Is there any example available with the same scenario ?

Thanks for reading!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:21:15+00:00Added an answer on May 28, 2026 at 2:21 am

    a simple spring batch solution might be:

    • domain model with an abstract parent class “targetTab” and specific classes for each target table, e.g. TargetTab1 extends TargetTab
    • reader which reads lines as list/map
    • (mapping option 1) custom FieldSetMapper Implementation which decides target table on first entry in list/map and creates a specific targetTab object, e.g. targetTab1
    • (mapping option 2)processor does the same as above FieldSetMapper
    • writer accepts all objects of type TargetTab
    • same writer checks type and decides which of the real writers (simple dao implementations) should be used

    a more extensible solution might introduce a pre-batch/script which splits the file in 3 (or more) files according to target table and a distinct batch for each type

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on getting multiple file uploads working for an model in my
Getting multiple data items in an element with linq to xml I have an
What is the best way to export data from multiple tables in MySQL. I'm
when upload the same file for the multiple times i am getting this error......
I'm trying to extract data from multiple Tables in a Word document. When trying
I'm having some problems with getting multiple file upload to work. When I select
Windows has GetFileTime API which allows getting file time information by open file handle.
Jeff wrote about getting a file version/datestamp a while back. Visual studio doesn't increment
Possible Duplicate: Getting a FILE* from a std::fstream Is there a way to obtain
I am using and getting a file from ftp server. But when I use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.