Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello I am using this code for Trigger Run If to determine if the file format is .csv to run a component. ((String)globalMap.get("FileName")).contains(".csv")
How can I code for everything else? Is there a java code to check if Not Contains .csv?
Hi,
contains() returns a boolean type.
In you case, if the filename contains ".csv", the expression returns true.
If I understood you correctly, you want every other file than .csv, so all files, that do not contain ".csv"?
Simply type:
!((String)globalMap.get("FileName")).contains(".csv")
Notice the exclamation mark. It means "not".
Hi
How does the file name come? Do you use a tFileList to iterate a folder? Can you please explain why you use the global available?
(String)globalMap.get("FileName")
Regards
Shong
Hi Edith,
If you don't mind, could you share a snapshot of your job design which you are trying to achieve. It helps us to know the requirement.
Here's a screenshot of the job. In the beginning of the job, I'm iterating a temp table that includes the FileName to the tRestClient. The FileName has the file format of .csv or .xls. If the FileName contains .csv, then it goes to tFileRowCount and prints the message in tJavaFlex. If the FileName contains something else other than .csv, then I only want to print the message.
Hi
Thanks for sharing your job, it is clear now. To get the current value of FileName column, the expression is:
(String)globalMap.get("rowN.FileName")
rowN is the row identifier such as row1 before tFlowToIterate
The java code to check if Not Contains .csv is:
!((String)globalMap.get("rowN.FileName")).contains(".csv")
Regards
Shong
Hi,
contains() returns a boolean type.
In you case, if the filename contains ".csv", the expression returns true.
If I understood you correctly, you want every other file than .csv, so all files, that do not contain ".csv"?
Simply type:
!((String)globalMap.get("FileName")).contains(".csv")
Notice the exclamation mark. It means "not".
Thank you @Bernhard Gruber for your time and help!