Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


Mikael
2015-10-06T13:16:26Z
How do you represent non-printable characters in Visualcron functions? I have a text file where fields are separated by the ascii Start-Of-Header character (0x01) and I want to replace those with semicolon before processing the file further. But how do I write the string.replace function?
Sponsor
Forum information
Support
2015-10-06T19:17:59Z
For this I would use the .NET Code Task or the PowerShell Task where you can specify a specific Chr in the code.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Mikael
2015-10-28T12:44:04Z
That's a

For anyone else, this is the simple code I used:

using System;

public class NPCReplace {
  public static string NPCReplace(string InputData, char FromChar, char ToChar) {
    return InputData.Replace(FromChar,ToChar);
  }
}


Then I just use a Read File step before this, use {TASK(PrevTask,Output)} as InputData and define CharacterToReplace as \u0001 and ReplacementCharacter as a semicolon.
Note that this only works on single characters. If you want to replace more than one character you need to change the 'char' to 'string'
Support
2015-11-02T10:28:30Z
Thanks for the feedback Mikael!
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top