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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
ar7368
Contributor
Contributor

File Transfer

Hi,
I have a job to modify filenames of files(pdf) from source with static data inserted in the fourth component of file name such that it will have the following format
TAC_CAT_time/date_Op2_uniqueID.pdf. The filenames will already contain TAC_CAT_DATE_unique ID.pdf. thus Op2 (case sensitive) is missing. The TAC and CAT components are 8 and 9 characters long respectively. I have figured out all of the above, except that when the MRN or HAR are not within 8 or 9 characters long i need to generate a error. Sometimes these components are keyed in wrong by users. How do I filter these files? to generate a email.
So in effect the 28th character in my filename needs to "_".
Labels (2)
22 Replies
ar7368
Contributor
Contributor
Author

The problems still persists. There is just one file each ( one from the filter and other from reject) moved to the destination folders. Why is this?. I have no clue why just one file is moved to the destination although the job says otherwise.
janhess
Creator II
Creator II

What are the input and output file names for your file copy?
Your tFilterRow should use .equals not ==
ar7368
Contributor
Contributor
Author

For tfilecopy1:
Filename is : ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))
Destiantion Filename : ((String)globalMap.get("tFileList_1_CURRENT_FILE")).substring(0,19)+((String)globalMap.get("tFileList_1_CURRENT_FILE")).substring(23,27)+((String)globalMap.get("tFileList_1_CURRENT_FILE")).substring(19,23)+"_"+"Op2"+"_"+((String)globalMap.get("tFileList_1_CURRENT_FILE")).substring(32,((String)globalMap.get("tFileList_1_CURRENT_FILE")).length())
--------------------------------------------------------------------------
For tfilecopy 3: Filename is : ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH"))
Destiantion : Local drive.

I know you suggested using routines but I haven't. Still there is no explanation to why just a single file gets moved but not the rest
janhess
Creator II
Creator II

You need to use the file name from tFilterRow for the output file name. The one from tFileList will always be the same as it's before the iterate.
ar7368
Contributor
Contributor
Author

you mean in Rename - destination fielname?
janhess
Creator II
Creator II

Sorry I'm talking rubbish - tFileList file name is after the iteration.
What does the tLogRow show for the file name in your earlier example?
ar7368
Contributor
Contributor
Author

Ok, the tlogrows shows the rejects and filtered files according to the condition specified in tfilterrows. I have merely replace the tlogrows with tfilecopy in the earlier example.
ar7368
Contributor
Contributor
Author

When I hit ctrl+space in Tfilecopy destination rename should I be choosing
"((Integer)globalMap.get("tFilterRow_3_NB_LINE_OK"))"... but what is the Integer part?.
janhess
Creator II
Creator II

OK I think the input file name is in the column name that comes out of tFilterRow - that's why it's displayed in tLogRow.
Does the file that's being created look like any of the names you're expecting?
ar7368
Contributor
Contributor
Author

yes in the tfilecopy( good files) i see one file with the modifications I have specified. Similarly in tfilecopy(reject files), I see one file that is not according to specifications. So of the 20 rows processed 9 are bad and 11 good. Problem: I see just one of each category in their respective destinations.