Converting CR to CRLF - VisualCron - Forum

Community forum

itbbf
  •  itbbf
  • Paid support Topic Starter
2014-01-21T08:55:40Z
Hello,

I am trying to convert Unix CR to Windows CRLF. So I read the file, then write it. While writing I have selected from task Main page encoding Windows Code Page 1252 and from the Write file tab selected Line break CrLf.

Unfortunately resulting text file still has Unix CR, not CRLF.

What bothers me is read file has output in the job log, showing lines in the file as expected. But the write file has no output, still the file gets written to the disk.
Support
2014-01-21T13:37:09Z
Just by reading and writing you are not actually converting the file. The setting in the Write file Task sets the line break ending characters for each time you append a line. In your case it results in appending the correct character in the end but keeping the original characters before.

Only way to do this is to run some kind of code that replaces these characters between the read and write Task. You could do it through scripting, Powershell and .NET Task.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
itbbf
  •  itbbf
  • Paid support Topic Starter
2014-01-21T14:56:08Z
Thanks,

ok. I kinda thought it would read and write line by line.

Anyways, converting CR to CRLF is simple from cli: TYPE filename_cr | MORE /E /P > filename_crlf

So how would I would pass that as execute task?
Support
2014-01-21T15:08:22Z
Originally Posted by: itbbf 

Thanks,

ok. I kinda thought it would read and write line by line.

Anyways, converting CR to CRLF is simple from cli: TYPE filename_cr | MORE /E /P > filename_crlf

So how would I would pass that as execute task?



If you really going that route, with cmd, you should create a batch file which echos the result to console. The schedule the batchfile with proper in-parameters.

It is probably more clean and less error prone to use the .NET Task.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top