Tue Sep 29, 2020 7:12 pm
Login Register Lost Password? Contact Us

Writing a Null character to a flat file

Comments and questions related to the Enterprise Control Language

Thu Oct 31, 2019 4:19 pm Change Time Zone

Example of file with null character
(59.63 KiB) Not downloaded yet
I am producing a tab delimited file but in some fields instead of an empty string I need to write out a null character. I am writing a process to replace an existing file from another system. Attached is a picture of the existing file shown in Notepad++ with all symbols shown

How do I do this?
Posts: 8
Joined: Mon Oct 07, 2019 5:57 pm

Thu Oct 31, 2019 5:53 pm Change Time Zone


You can do it just like this:
Code: Select all
Nul := '\000';
ds := DATASET([{'ABC',Nul,'DEF'}],{STRING3 F1,STRING3 F2,STRING3 F3});
The Nul definition uses the octal constant form for string constants to specify the character is an ASCII zero.


Community Advisory Board Member
Community Advisory Board Member
Posts: 1556
Joined: Wed Oct 26, 2011 7:40 pm

Thu Oct 31, 2019 6:42 pm Change Time Zone

darn, simple. I should have thought of that. thanks
Posts: 8
Joined: Mon Oct 07, 2019 5:57 pm

Return to ECL

Who is online

Users browsing this forum: No registered users and 1 guest