CopybookInputFormat icon indicating copy to clipboard operation
CopybookInputFormat copied to clipboard

Regarding Headers

Open anayyar82 opened this issue 9 years ago • 0 comments

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.

anayyar82 avatar Feb 05 '16 20:02 anayyar82