Questions tagged [flatfilereader]

32 questions
0
votes
1 answer

How to set skipLimit when using spring batch framework to execute a step concurrently?

I use spring batch to load data from a file to a database.The job contains only one step.I use a ThreadPoolTaskExecutor to execute step concurrently.The step is similar to this one. public Step MyStep(){ return StepBuilderFactory.get("MyStep") …
0
votes
0 answers

Accessing the resource read by FlatFileReader in SkipPolicy SpringBatch

I am working on a Spring Batch application that reads some files and persists it to DB. I am handling error conditions using the Skip Policy. How do I get access to the file name that is read in the reader ? public FileProcessSkipper(int skipCount)…
Siva
  • 1
0
votes
1 answer

Spring Batch - How to store lines read from CSV into a execution context for Restartability

I am not sure if the FlatFileItemReader has the capability to store the last line when an exception is being met. So that when i re-run the batch application it will be able to continue from the last line. Any example to implement the following use…
0
votes
3 answers

How to print first word from a file separeted by a tab line?

i am trying to read a file and print only the first number from each line . i have tried to use split, but it never return correct result , it just print entire contetn as below in the table. Any help would be highly appreciated **thats my file**…
0
votes
0 answers

calculate sum of (current due,past due,past due 30,past due 60 and over 90) from column and compare with last column Ar_exposure

calculate sum of values (current due,past due,past due 30,past due 60 and over 90) from column and compare with last column Ar_exposure. enter image description here so far I tried code below: public class Employee { public static void…
Anil
  • 1
  • 2
0
votes
2 answers

Can I use FlatfileItemReader with Taskexecutor?

Can I use FlatfileItemReader with Taskexecutor in spring batch?? I have implemented FlatFileItemReader with ThreadPoolTaskExecutor. When I print the records in ItemProcessor, I do not get consistent results, i.e. not all the records are printed and…
0
votes
1 answer

How to build conditional flat file import with fixed length columns

I'm using Teiid 9.3.7 with Wildfly 10 due to Teiid Designer version compatibility. I'm trying to build a view out of a flat file. There are two different types of entries in the file. Each type of entry has a key attribute that I need in order to…
dinky
  • 1
  • 1
0
votes
1 answer

Spring Batch empty file using FlatFileItemReader xML

I'm trying to validate if an input file is empty or has data. I'm working with spring batch thru XML beans config, my actual config is like:
Csanchez
  • 373
  • 1
  • 16
0
votes
0 answers

Spring Batch - How to save header information into individual row objects in FlaFileItemReader

I am dealing with a text file delimited by a '|' having header and data followed by a trailer. This sequence can repeat in the same file. So my format is something like this Header|Date - Employer1#|
Employee ID|FirstName|LastName|
Employee…
Guest
  • 1
0
votes
0 answers

In Spring Batch, Custom Mapper, is there a way the mapping is done on basis of column names?

In the Custom Mapper, everywhere I checked, the mapping is done on basis of column index. Is there a way we can get the data on basis of column names? So suppose I need to read a .csv file with 10 columns and I want only below five columns.
Pallav
  • 9
  • 1
0
votes
1 answer

FlatFileItemReader and FlatFileItemWriter Using Batch Job

I want to read, parse and write data from text file. I achieved this but I have a question about the declaration of the identifiers. I show my class below. CustomerDataMapper.java public class CustomerDataMapper implements FieldSetMapper
S.Balaban
  • 174
  • 2
  • 19
0
votes
1 answer

How to write custom flat file item reader using xml configuration

i am new to spring batch. I am using flat file item reader, configured in xml file. then there is a processor which processes each obj created. I need to pre process contents of file before passing it to file item reader. The processed results/file…
Gayatri
  • 11
  • 2
0
votes
2 answers

Update file after FlatFileItemReader in Spring Batch

I currently have the following processing in a Spring Batch job: FlatFileItemReader reads a CSV file Processor does some work FlatFileItemWriter creates a mirror of the read file, but updates the file to reflect processing I don't want to write to…
colmulhall
  • 1,548
  • 3
  • 18
  • 33
0
votes
0 answers

Reading different CSV files using FlatFileItemReader Spring Batch

I tried to find a solution for the problem I am looking for, but I dint find it or a chance that I might skipped. Help me if you can redirect me to the solution page. Input to the batch: I have TRADES.csv, PORTFOLIO.csv files which are located at…
Rajesh Kumar
  • 39
  • 1
  • 11
-1
votes
1 answer

Reading a text file using spring batch where records are of different length i.e not in fixed length

I having a text file having records as below name(1-3),age(4-5),ownCar(6)(if has put Y else leave blank) Samples of data : Dom32Y Pat22 Sam23 Rob45Y So here if you see each record is not of fixed length in size..So how can i read this text file…
sekhar
  • 47
  • 1
  • 5