Skip to content

Regarding Headers #1

@anayyar82

Description

@anayyar82

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions