CopybookInputFormat
CopybookInputFormat copied to clipboard
Regarding Headers
Hello Ted, i want to add the header as well, i am not sure where i can add it. when i tried to write inside record reader, its coming but attached with all the rows. Can you please guide where can i call the get header function. my final output is CSV including header.
public static String getRecordHeader(ExternalRecord externalRecord){
StringBuilder strBuilder1 = new StringBuilder();
String headerFields = "";
for (ExternalField field : externalRecord.getRecordFields()) {
strBuilder1.append(field.getCobolName().toString()+",");
}
headerFields = strBuilder1.toString()+"\n";
return headerFields ;
}
can you please tell where can i call the function so that i will get it on the top of file only.