I have two csv sources to read data from. Both of the csv files provide the same data but with different name or column location. Is there a way to add @CsvBindByByName with "OR". For example, the headers of two files are as follows
CSV 1 - RollNo, StudentName, Class, Age, PrimaryLanguage, ProjectName
CSV 2 - Name, Class, PrimLang, EnrollmentNumber, Age, Project, AttendancePercentage
And I have to read both of the csv file information in same POJO.
public class StudentInfo{
@CsvBindByName(column = "RollNo")
private String rollNo;
@CsvBindByName(column = "StudentName")
private String studentName;
@CsvBindByName(column = "PrimaryLanguage")
private String primaryLanguage;
@CsvBindByName(column = "Class")
private String class;
@CsvBindByName(column = "ProjectName")
private String projectName;
@CsvBindByName(column = "Age")
private String age;
//getters and setters
}
Or is there an alternate way to achieve this. My code is working fine if I take only one csv header format. Thanks