Struggling to find a way to write regex captured values to a file

Hi All,

I have two lists captured from previous regex. My requirement is to loop through these lists and write the values to a file. I’m trying to do it with the below code.


.foreach("${accountNumber}", “accountNumber_id”, “counter”)


.exec(session => { CreateFeederFile.createFPSFeeder("${accountNumber_id}", “${iban(counter)}”)



But all I can see in the file is as below.


The values are not being replaced.

I can see my code is not working but not sure how I can achieve my requirement.

Please can you help.


Hi All,

Slightly changed the logic as below.

.foreach("${iban}", “iban_id”, “counter”)

.exec(session =>session.set(“accountNumber_id”, session(“iban_id”).as[String].slice(13,8)))

But not is getting saved to accountNumber_id.

Please can you guide me.

Kind Regards,


I’ve tried every thing I can think of.

val iban = session(“iban_id”).as[String]

println( “iban_id as var is>>>>>>>>>>> :” + iban.toString.slice(3,3) )

println( “iban_id as substring is>>>>>>>>>>> :” + iban.substring(3,3) )

nothing is working.

Please can you help.

Sorted, thanks !!!