Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
So I have a talend job that takes files from a remote file system and transfers the files from the remote directory using tFTPFileList and tFTPGET to hbase. However, I need to collect the date of the file created or initially stored in the remote file system as:
Basically, I need the Jun 25 09:06 date of the file created from my remote file system and transferred to my talend along with
my file using tFTPGET. I can get the file but I do not know how to transfer the date of the file. Please do tell me how I can go about this as soon as you can!
Thanks in advance!
Nevermind I solved, I have to use the filepath instead of the filename. That was a silly mistake.
So I am trying with tSSH by trying to run the command: "date - r context.filename %m-%d-%Y" by inputting this command in the command box in the tSSH component however I get ./filename not a directory when I run the job. Would you know how I can get the filename/value, stored in context.filename, inputted in place of the context.filename in the command above?
Sorry for the misunderstanding. So I did whatever you mentioned in your response, my problem is:
I am getting the file and its filename from FTPFileList and FTPGet. The filename is later stored context.filename. Now I am connecting back to my remote filesystem using tSSH and am trying to run the command "date -r context.filename %m-%d-%Y" and inputting this command in the command box of tSSH, in hopes that when the job runs, the command is executed in remote filesystem linux environment and I get back the output of the date. I know how to print out the date but what I do not know how to input the actual filename in place of context.filename in the command. i.e. say my context.filename = parse.xml. I want to run the command: "date -r parse.xml %m-%d-%Y" in the remote linux environment to get the date I need. In doing so, I run this instead: "date -r context.filename %m-%d-%Y", but I am getting either ./filename does not exist or null values. How can I go about fixing this.
Thanks
Nevermind I solved, I have to use the filepath instead of the filename. That was a silly mistake.
sorry for my misunderstanding.
tJava , write java code:
context.filename = <ctrl+space tFTPFilelist current filename> ;
and in tSSH, change it into:
"date -r " +context.filename+ " %m-%d-%Y"