I have a requirement where the file name is of pattern 'aaxxxx_date_SequenceNumber.zip'. There could be multiple files from same day. I need to process only the most recent file. I have to use Sequence number to find the most recent file
Boomi picks the file from FTP in first to last manner. But your requirement is different.
One workaround could be , pick all files from FTP and drop in a diff folder , fetch the max sequence number from the files and save in a prop.
Now at any moment do a check in upper folder again and process if file is available with sequence number greater than property , which means a new file was available , also if there is no file with greater sequence value than only the files from new folder where the sequence number is equal
This way at a given moment only the recent file will be picked with max sequence number
The File name pattern is aayyybb_20160606_U2496_S0058.ZIPThe logic to find the most recent file is depending on the sequence number which starts with 'S'. The max sequence number will be S9999 and after that it starts again from S0001.For e.g.aayyybb_20160606_U2496_S0058.ZIPaayyybb_20160606_U2496_S0059.ZIPMost recent is s0059
aayyybb_20160606_U2496_S9999.ZIPaayyybb_20160606_U2496_S0001.ZIPMost recent is s0001
aayyybb_20160606_U2496_S9999.ZIPaayyybb_20160606_U2496_S0001.ZIPaayyybb_20160606_U2496_S0002.ZIPMost recent is s0002
What would be the best way to get most recent file?
Have you tried the above approach?
I created a quick video on how to solve the above issue. Go thorough it and let me know if you have any questions: https://youtu.be/7OyY9djCbK8?t=3s
i saw your video. I hope you did some mocking his example. But your answer is not working for Amarnath question.
please let us know what it will happen if the filename will be
I am sure your process results GENELB_20160718_U4414_S9998.ZIP is the recent file which is wrong.
Yes. You are right, my understanding was that when the fielname "GENELB_20160718_U4414_S9999", it should NOT be treated as the latest. Remove the logic where I reset the 9999 to 0000 and try it.
Can you write out and execute a batch file? Pipe the result to a text file, then read it in?
Read in N files:
Sort by date & time (/O:-D Date & time):
Dir - list files and folders | Windows CMD | SS64.com
In the past, I've leveraged WinSCP and the Program Command Shape for special ftp process requirements. That said, you can create a batch file with parmameters from your process where WinSCP can download the latest file, using -latest switch of the get command (WinSCP 5.8 beta and newer only):
winscp.com /command ^ "open ftp://username:firstname.lastname@example.org/" ^ "cd /Client/ABCCompany/" ^ "get -latest *.csv" ^ "exit"
Hope this helps.
I want to make a call to a shell script in SFTP location from a .bat file. For this purpose, the command I placed in the .bat file was:cd C:\Program Files (x86)\WinSCP\winscp.com /command "open sftp://username:password@host/ -hostkey=" "2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx""" "Is" "cd ./path/" ^ "call /path/example.sh" ^ "exit"
The above command works fine when executed manually on a windows system, but when run on boomi Im getting the following error:
Continue connecting to an unknown server and add its host key to a cache?The server's host key was not found in the cache. You have no guarantee that the server is the computer you think it is.The server's rsa2 key fingerprint is:ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xxIf you trust this host, press Yes. To connect without adding host key to the cache, press No. To abandon the connection press Cancel.(Y)es, (N)o, C(a)ncel, (C)opy Key: CancelHost key wasn't verified!Host key fingerprint is ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
Any suggestions on how to pass "Y" as a parameter to the above command?
Retrieving data ...