Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Replace backslash from filepath

Hi,
I want to validate all .xml file against relative .xsd file. I have to fetch each .Xml file from "xmldataload/data" and .Xsd from "xmldataload/conf" directory. So I have created my job as mentioned below

tFileList-------------------------------> tXSDValidator
Properties assigned
tFileList
Directory: xmldataload/data

tXSDValidator
Xsd file:
((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")).toLowerCase().replace("/data","/conf").replace(".xml",".xsd")
Xml file:
((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))

I am facing issue with replace function. for .Xsd file path replace function is not working for "/" backslash.
replace("/data","/conf") is not replacing the string.
If I write
replace("data","conf") then Its works but in my file path xmldataload/data also got chaged to xml confload/ conf rather then I want xmldataload/ conf
Please help to get proper file path.
Labels (3)
2 Replies
Anonymous
Not applicable
Author

Hi
((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")).toLowerCase().replace("/data","/conf").replace(".xml",".xsd")

Change it to this expression should work.
((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")).toLowerCase().replace("\\data","\\conf").replace(".xml",".xsd")

Shong
Anonymous
Not applicable
Author

Thank you Shong... Its work.