ChoETL
ChoETL copied to clipboard
ChoFixedLengthReader v1.2.1.48 bool not read
Updated to version 1.2.1.48 and now my bool fields are always false
Program.cs
using ChoETL;
using ChoETLTest;
foreach (var e in new ChoFixedLengthReader<TestData>("TestData.txt"))
Console.WriteLine("TestBool1: " + e.TestBool1 + " TestBool2: " + e.TestBool2 + " TestBool3: " + e.TestBool3 + " TestBool4: " + e.TestBool4 + " TestString: " + e.TestString);
TestData.cs
using ChoETL;
namespace ChoETLTest
{
internal class TestData
{
[ChoFixedLengthRecordField(0, 1)]
public bool TestBool1 { get; set; }
[ChoFixedLengthRecordField(1, 1)]
public bool TestBool2 { get; set; }
[ChoFixedLengthRecordField(2, 1)]
public bool TestBool3 { get; set; }
[ChoFixedLengthRecordField(3, 1)]
public bool TestBool4 { get; set; }
[ChoFixedLengthRecordField(4, 1)]
public string TestString { get; set; }
}
}
TestData.txt
0101a
1111b
1011c
0000d
1000e
Set this statement prior to the parser ChoTypeConverterFormatSpec.Instance.BooleanFormat = ChoBooleanFormatSpec.ZeroOrOne;
Great, thanks, haven't seen any notes that it is needed now. I remember that tried it already, but after some testing I have seen now that I need it to set for every task on its own, globally didn't work.