Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
abhi90
Creator II
Creator II

Reading a File and creating a Output File with Same Name

Hi All,

 

I am trying to generate outputfile based on name of my Input File. My requirement is I have 5files in a directory and I have to read them. After my Data Processing jobs completition i have to generate a output file which name will be exact same with Input File read at the start of data processing. example:If i am reading FileName1.txt then at the end FileName1.txt should also generate. I am using tfilelist CURRENTFILE After variable in tfileoutputdelimited but no use. If anyone can help will be really helpful 

@TRF@rhall@nthampi@xdshi

Labels (2)
1 Solution

Accepted Solutions
manodwhb
Champion II
Champion II

@abhi90,can you design in below way and call file from ((String)globalMap.get("tFileList_1_CURRENT_FILE")) to outputfile name.

0683p000009LzVu.png

View solution in original post

6 Replies
abhi90
Creator II
Creator II
Author

manodwhb
Champion II
Champion II

@abhi90,can you design in below way and call file from ((String)globalMap.get("tFileList_1_CURRENT_FILE")) to outputfile name.

0683p000009LzVu.png

TRF
Champion II
Champion II

tFileOutputDelimited is executed 1rst and create an empty file (as soon as Append option is not ticked).

So, when tFileInputDelimited starts, the file is empty.

To avoid this problem, you need an intermediate file.

fdenis
Master
Master

you cannot have 2 access to the same file in the same time.
but you can preload (tPrejob) your file into hashMap (tHashMap) or file
and in the same job write your file normally.
Jesperrekuh
Specialist
Specialist

Make sure you have a different output folder where you place your output file.

 

Kudos for everybody... 

abhi90
Creator II
Creator II
Author

Thanks to everyone.i tried with all the solutions given and worked. accepted everyone's solution 0683p000009MACn.png