简体   繁体   中英

Spring Batch read different csv files and xml output

I have a requirement where I need to read 4 different csv files. These have to be read line by line. All files have different number of columns and values.

After processing, I have to generate the output in XML.

If someone can please throw some light, that how to achieve this?

Thanks

Spring Batch has a reader interface. You can write your own reader class which can have 4 individual FlatFileItemReaders and read them until all are done.

The writer is also an interface that you can implement yourself. You'd override the write method and do whatever you needed to do.

http://docs.spring.io/spring-batch/trunk/apidocs/org/springframework/batch/item/ItemReader.html http://docs.spring.io/spring-batch/trunk/apidocs/org/springframework/batch/item/ItemWriter.html http://docs.spring.io/spring-batch/reference/html/readersAndWriters.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM