I am new to spring batch . I have to validate header and footer before processing . I am able to get header but not footer.
Asked
Active
Viewed 119 times
0
-
Does this answer your question? [Skip number of footer lines in Spring batch](https://stackoverflow.com/questions/45278568/skip-number-of-footer-lines-in-spring-batch) – Mahmoud Ben Hassine May 06 '20 at 08:32
1 Answers
0
You can use a ItemProcessor, something like below;
public class DataProcessor implements ItemProcessor<String, String> {
@Override
public String process(String line) throws Exception {
if (line != null && line.contains("footer")) {
return "Footer Found";
} else {
return line;
}
}
}

soorapadman
- 4,451
- 7
- 35
- 47

brijesh
- 760
- 6
- 4