Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] TFileExist

Hi,
We wanted to set a filename into a TFileExist component and we don't know how to do it:
We've try that: context.rep_local+"ANATTAET.*.txt"
We've try that: context.rep_local+"ANATTAET*.txt"
And that did'nt work. The filename change all the time and we cannot specify a specific filename (unfortunatly)
Thx for your help
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

- Use an "Interate Row" to connect tFileList_1 and tFileExist_1 (since you gave a wildcard expression in Filemask setting for tFileList_1)
- make sure that the setting for Directory in tFileExist_1 is a valid Directory

View solution in original post

9 Replies
Anonymous
Not applicable
Author

Hi,
you could try to set the following   context.path +    Numeric.random(0,100)  + ".txt" .
In the File components guide at :
you'll find an example (worth reading 0683p000009MA9p.png😞
Scenario: Checking for the presence of a file and creating it if it does not exist
BR Marcus
Anonymous
Not applicable
Author

The files always begin by ANATTAET and I don't find the correct syntax in the component guide
Anonymous
Not applicable
Author

Please describe the context for using the tFileExist in your Job.
Anonymous
Not applicable
Author

0683p000009MB6N.png 
Hi,
We want to check if a file exist with an if ((Boolean)globalMap.get("tFileExist_1_EXISTS")) before to put it on FTP Server
Anonymous
Not applicable
Author

It seems you are using wrong file name format. the way you specified it will not work with this component, 
you can better use tFileList FTP then compare file list with source files. 
Anonymous
Not applicable
Author

Assuming you use a tFileList component ... add a Filemask like "ANATTAET*.txt"
and then in your tFileExist component use ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")) as your File name/Stream
Anonymous
Not applicable
Author

  0683p000009MBpH.png 
Thank you for your answer but when I tried I get the following error:
Démarrage du job FtpCheck_by_RC a 16:44 04/12/2014.
connecting to socket on port 3566
connected
Exception in component tFileExist_1
java.lang.NullPointerException
    at java.io.File.<init>(File.java:277)
    at gate.ftpcheck_by_rc_0_2.FtpCheck_by_RC.tFileExist_1Process(FtpCheck_by_RC.java:1866)
    at gate.ftpcheck_by_rc_0_2.FtpCheck_by_RC.tFileList_1Process(FtpCheck_by_RC.java:1782)
    at gate.ftpcheck_by_rc_0_2.FtpCheck_by_RC.tServerAlive_1Process(FtpCheck_by_RC.java:803)
    at gate.ftpcheck_by_rc_0_2.FtpCheck_by_RC.runJobInTOS(FtpCheck_by_RC.java:5935)
    at gate.ftpcheck_by_rc_0_2.FtpCheck_by_RC.main(FtpCheck_by_RC.java:5791)
disconnected
Job FtpCheck_by_RC terminé à 16:44 04/12/2014.
Anonymous
Not applicable
Author

- Use an "Interate Row" to connect tFileList_1 and tFileExist_1 (since you gave a wildcard expression in Filemask setting for tFileList_1)
- make sure that the setting for Directory in tFileExist_1 is a valid Directory
Anonymous
Not applicable
Author

OK I think I found a way
Again thank you for your help, good evening