I have a .csv file which need to be renamed by using a parameter in that .CSV.
I would need a script expression to do this.
It should be like:
if tag <MyParam> contains yes
then add prefix Y
else add prefix N
Can anyone translate it into a propre javascript expression?
Thanks!
Fist
easy script for rename job flow element?
Re: easy script for rename job flow element?
This Script Expression will search for SearchString in the current job. You can use this Script Expression in the Rename Job element to choose which prefix to add.
Code: Select all
var fileContent = File.read(job.getPath(), "UTF-8");
var theReturn;
if (fileContent.find("SearchString") > 0)
{
theReturn = "Found";
}
else
{
theReturn = "NotFound";
}
theReturn;