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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Pass filename stored in CSV-File to tfileinputXML

Hi,
I would like to compare the content of two files. I have a list of pairs stored in csv file:

Example of pairs.csv
Filename_CSV;Filename_XML
/path/to/file/1.csv;/path/to/file/1.xml
/path/to/file/2.csv;/path/to/file2.xml

How can I passed the filenames of the "Filename_CSV" column to the tfileinputdelimeted component and the filenames of "Filename_XML" column to the ffileinputxml component?
Labels (3)
16 Replies
Anonymous
Not applicable
Author

I didn't understand what you exactly mean by compare the content of two file?
For the second part there is a solution but I want to be sure that you only want to get the information in each file.
Anonymous
Not applicable
Author

I want to compare the content of 1.csv to the content of 1.xml.
The comprehension already works manually, but I don't know how the tfileinputXML-component can get the filename stored in the pairs.csv file.
There is a solution?
Anonymous
Not applicable
Author

Hi,
you can try to use a tFileInputCsv (with two attributes) and a iterate link. In each iteration you can get the filenames from the globalMap.
Bye
Volker
Anonymous
Not applicable
Author

Hi Volker,
thanks for your replay, but I don't know how to use globalmap within a java job.
The component, which reads the pairs.csv is called "tFileInputDelimited_2" and the column is called "Filename_CSV".
I tried the following string, as input-flow:
((String)globalMap.get("tFileInputDelimited_2.Filename_CSV"))
But it doesn't work.
Anonymous
Not applicable
Author

tFlowToIterate is the component you need 🙂
Anonymous
Not applicable
Author

You are my personal hero...
Thanks
Anonymous
Not applicable
Author

Well it only works almost. My job just compares the last pair of files in my lookup filelist. I tried to setup an iteration connector to both tfileinput-components, but this seems to be forbidden. So what can I can do, so that my job reads the lookup filelist step by step.
Anonymous
Not applicable
Author

You should add a iterate link between "iterate lookup list" and "read current csv file". If you do not have a link you have two jobs with no connection and each job is executed only once. Therefore you get only one "output".
Bye
Volker
Anonymous
Not applicable
Author

Then I get this error message:
Starte Job compare_content am 22:41 20/03/2008.
Exception in component tFileInputXML_1
java.net.MalformedURLException
at java.net.URL.<init>(URL.java:601)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at geschaeftsmodell.compare_content.compare_content.tFileInputXML_1Process(compare_content.java:1029)
at geschaeftsmodell.compare_content.compare_content.tFileInputDelimited_2Process(compare_content.java:204)
at geschaeftsmodell.compare_content.compare_content.runJobInTOS(compare_content.java:1231)
at geschaeftsmodell.compare_content.compare_content.main(compare_content.java:1150)
Job compare_content endet am 22:41 20/03/2008.