Question

Read header information from Groovy Evaluator

  • 24 November 2022
  • 2 replies
  • 31 views

Hello All,

 

I am reading file and parsing in Groovy Evaluator. File name is part of header information in Groovy Evaluator. 

Need help on how to read the information from header which is available at each record level

Thanks,

Bhaskar Pola


2 replies

With below instruction was able to fetch header information in Groovy

All the header information is available via attribute

record.attributes['filename']

 

Thanks,

Bhaskar Pola

Userlevel 5
Badge +1

@polabhaskar 

can you please try this and let me know if it helps.

If you can provide me the test data and the expected result , then I can give a try to provide the pipeline for the same.

 

newRecord = sdcFunctions.createRecord('header')

for record in sdc.records:

     def file1 =  record.value['File_Name']

    newRecord.value = ["txt":HEADER,"FILE":file1]

 

Thanks & Regards

Bikram_

Reply