May 2015
Intermediate to advanced
234 pages
4h 18m
English
A read/process/write step is a common type of step where some data is read somewhere, processed in some way, and finally, saved somewhere else. In this recipe, we'll read a CSV file of users, increment their age, and save the modified users in a database as shown in the following image:

This is our CSV file of users, input_data.txt:
Merlin, 333 Arthur, 37 Lancelot, 35 Tristan, 20 Iseult, 22 Mark, 56
For each line of the CSV file, we'll create a User object. So, make sure that the User class exists:
public class User {
private String firstName;
private int age;
…
}Each User object will be saved in the database. ...
Read now
Unlock full access