Can i use unzip session in workflow when the file is a .txt file - teradata

I am working on an Informatica workflow and using Teradata Database. The file is a .txt file.
When I run the workflow I get the error message below.
Error opening file [/infa_shared/uss/SrcFiles/vnd_MG//PRx]. Operating system error message [no such file or directory].
I have an unzip session in the sessions.

You can always use a command task to execute the unzip explicitly.
If your file name is PRx.txt, then the command line of the task will be:
unzip /infa_shared/uss/SrcFiles/vnd_MG//PRx.txt
Then in the next connected session, associate the source file with the filename you have extracted from your .txt archive - in your session's mapping setting.

Related

Informatica Flat File source name

I am working on a project were we need to load flat file eg : (Gemstone_20220325.csv) I have given the source name as (Gemstone_*.csv) in script to search for the file in the path.
But it is failing with error , No such file .
Is that anything I am missing . Any idea on this is much appreciated .
You need to put either exact name or use a file list with the name of the file and then use indirect file type in the session that is reading the file.
You can use a pre session shell command like this ls -1 Gemstone_*.csv>/infa/home/tmp/Gemstone_filelist.txt. Or you can create a shell script too with this command for better control.
in the session that is reading this file, set the property to indirect file type and mention /infa/home/tmp/Gemstone_filelist.txt as file to be extracted.
Infa will pick files one by one and process them.
Once the file gets processed, delete it using a post session command task rm -f Gemstone_*..

Executable file not found

I have a python code that is taking some info from a website by selenium and then write them into a json file, after I created an '.exe' file by pyinstaller and run it I don't know where this json file is saved.
Where could be saved, should be in the initial directory?

Can pscp transfer to a temporary file and rename once done?

I have a very big file that has to be transferred to a remote server.
On that remote server there is a job activating each 5 min that, once sees a file name starting with the right prefix, processes it.
What happens if the job "wakes up" in the middle of transfer? In that case it would process a corrupted file.
Do pscp create a .temp file and renames it accordingly to account for that? Or do I have to handle this manually?
No pscp does not transfer the files via a temporary file.
You would have to use another SFTP client – If you use pscp as SFTP client. The pscp defaults to SFTP, but it falls back to SCP, if SFTP is not available. If you need to use SCP (what is rare), you cannot do this, as SCP protocol does not support file rename.
Either an SFTP client that at least supports file rename – Upload explicitly to a temporary file name and rename afterwards. For that you can use psftp from PuTTY package, with its put and mv commands:
open user#hostname
put C:\source\path\file.zip /destination/path/file.tmp
mv /destination/path/file.tmp /destination/path/file.zip
exit
Or use an SFTP client that can upload a files via a temporary file automatically. For example WinSCP can do that. By default it does for files over 100 KB only. If your files are smaller, you can configure it to do it for all files using the -resumesupport switch.
An example batch file that forces an upload of a file via a temporary file:
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/log="C:\writable\path\to\log\WinSCP.log" /ini=nul ^
/command ^
"open sftp://username:password#example.com/ -hostkey=""ssh-ed25519 255 ...=""" ^
"put -resumesupport=on C:\source\path\file.zip /destination/path/" ^
"exit"
The code was generated by WinSCP GUI with the "Transfer to temporary filename" options set to "All files".
See also WinSCP article Locking files while uploading / Upload to temporary file name.
(I'm the author of WinSCP)
Related question: SFTP file lock mechanism.

How to rsync a file which does not have extension?

I'm trying to write a script in Synology to copy one system file (a file containing CPU temperature value) to another server. The file does not have extension. I always get the error
rsync: read errors mapping "/sys/class/hwmon/hwmon0/device/temp2_input": No data available (61)
Please note that I already created private/public keys for using rsync without having to input the remote server password. I've tried the rsync command in terminal and it produces the same result. The location of the file is definitely correct.
Need your help.
cd /
rsync -e ssh /sys/class/hwmon/hwmon0/device/temp2_input bthoven#192.168.x.xx:/usr/share/hassio/homeassistant/syno
rsync: read errors mapping "/sys/class/hwmon/hwmon0/device/temp2_input": No data available (61)

Read Doc file and file path from Browser

I have an issue that I want to read a DOC file in my system but the condition is
Suppose you are working on browser and download some PDF or DOC file ,then my program should run and get the path of that file and convert that doc file in binary format.
the file download path may be change because some time it download in default folder but some times you saves that file in other locations.
my concern is this that code should execute at download time and should get file path from download history and read that file.

Resources