Search

GlobalSCAPE Knowledge Base

Transforming UNIX-based Text Files to DOS Format

Karla Marsh
EFT

THE INFORMATION IN THIS ARTICLE APPLIES TO:

  • EFT v6 and later

DISCUSSION

The Advanced Workflow Engine for EFT is able to help in a multitude of automation functions. Many customers, when integrating with diverse environments, find themselves having to contend with crossing the bridge between UNIX-formatted text-based files and DOS-formatted text files. Below is a short script that can help you transform a UNIX-based text file into a DOS-formatted file by transforming the use of the LF to a CRLF.

<AMVARIABLE NAME="targetFile">C:\temp\test_lf2.TXT</AMVARIABLE>

<AMVARIABLE NAME="newData"></AMVARIABLE>

<AMVARIABLE NAME="filePart"></AMVARIABLE>

<AMLOOP TYPE="FILECONTENTS" FILE="%targetFile%" RESULTVARIABLE="filePart" DELIMITER="%Chr(10)%" ENCODING="utf-8">

<AMSET VARIABLENAME="newData">%newData &amp; filePart &amp; Chr(13) &amp; Chr(10)%</AMSET>

</AMLOOP>

<AMFILEWRITE FILE="C:\temp\test_lf2_translated.txt" APPEND="NO">%newData%</AMFILEWRITE>

Details
Last Modified: 8 Years Ago
Last Modified By: kmarsh
Type: HOWTO
Rated 1 star based on 15 votes.
Article has been viewed 17K times.
Options
Also In This Category
Tags