Skip to content

Regarding Headers #1

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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