Skip to main content
Question

Read header information from Groovy Evaluator

  • November 24, 2022
  • 2 replies
  • 50 views

polabhaskar
Fan

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

Bikram
Headliner
Forum|alt.badge.img+1
  • Headliner
  • 486 replies
  • November 24, 2022

@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_


polabhaskar
Fan
  • Author
  • Fan
  • 1 reply
  • November 28, 2022

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


Reply