I'm using Talend to extract database field names from the table and write to a csv them after replacing the "_" in field names with " ". I want to have these values against the actual headers.
eg:
|First_Name|Last_Name|
|----------|---------|
|First Name|Last Name|
My job looks similar to following.

Code in tJavaRow is as follows:
for (java.lang.reflect.Field field:
input_row.getClass().getDeclaredFields()) {
String fieldName = field.getName();
String newFieldName = null;
newFieldName = fieldName.replaceAll("_", " ");
context.columnName = newFieldName;
System.out.println("Field name is " + context.columnName );
}
How can I get the value of this context variable for each field in csv file? If I directly use it in the tmap it will only have name of the last field as value.
tmap I had between tJava and the tFileOutputDelimited.
tMaplook like? What is stored in the context? - tobi6