- 1 year ago
download ANSI file using SFTP from OpenVms to windows system. Extra nul characters added in the file
When transferring files from OpenVMS to a Windows system using SFTP, you may encounter issues with the file format, especially if the file is in ANSI format. The problem you are facing with extra NUL characters being added to the file is likely due to differences in line endings between OpenVMS and Windows.
OpenVMS uses a different line ending convention than Windows. OpenVMS uses a single line-feed (LF) character to represent the end of a line, while Windows uses a carriage return (CR) followed by a line-feed (LF) character (CRLF) to represent the end of a line.
To fix the issue and ensure proper line endings in the transferred ANSI file, you can use the text
mode during the SFTP transfer. The text
mode will automatically convert the line endings to the appropriate format for the destination system (in this case, Windows).
Here's how you can transfer the ANSI file from OpenVMS to Windows using SFTP with the text
mode:
Open a command prompt or terminal on the Windows system.
Use the
sftp
command to initiate the secure file transfer:csssftp username@openvms_host
Replace
username
with your username on OpenVMS andopenvms_host
with the hostname or IP address of the OpenVMS system.Enter your password when prompted to establish the SFTP connection.
Change to the directory on the OpenVMS system where the ANSI file is located:
bashcd /path/to/ansi_file_directory
Transfer the ANSI file to the Windows system using the
get
command with thetext
option:arduinoget -text your_ansi_file.txt
Replace
your_ansi_file.txt
with the name of the ANSI file you want to transfer.
The get -text
command will ensure that the line endings are converted to Windows format during the transfer, eliminating any extra NUL characters that may have been added.
Once the transfer is complete, you should have the ANSI file on your Windows system with the correct line endings, ready for use.