You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a fixed length file with variable length price.
public class PriceRecord
{
FieldFixedLength(8)]
public string Person; [FieldFixedLength(3)]
public string Price;
[FieldFixedLength(20)]
public string Address;
}
Price is not receiving as fixed length, we get price as : 4 length or 5 length characters e.g. 1000, 10000 or 118.3 or 18.3
Any record more than 3 characters is an error record. however, I wanted to import it as valid record, I mean I want field level variable length.
var engine = new FixedFileEngine();
engine.ErrorManager.ErrorMode = ErrorMode.SaveAndContinue;
engine.AfterReadRecord += AfterReadRecord;
PriceRecord[] result = engine.ReadFile(@"D:\\PriceRecord.txt");
foreach (var detail in result1)
{
Console.writeline( " Customer: {0}, ",detail.Customer);
}
In this 4 or 5 length recordlines are treated as error line.
Thanks,
The text was updated successfully, but these errors were encountered:
dhananjay77
changed the title
Variable length records
Variable length fields in a fixed length record
Dec 17, 2020
I have a below requirement :
I have a fixed length file with variable length price.
public class PriceRecord
{
FieldFixedLength(8)]
public string Person;
[FieldFixedLength(3)]
public string Price;
[FieldFixedLength(20)]
public string Address;
}
Price is not receiving as fixed length, we get price as : 4 length or 5 length characters e.g. 1000, 10000 or 118.3 or 18.3
Any record more than 3 characters is an error record. however, I wanted to import it as valid record, I mean I want field level variable length.
var engine = new FixedFileEngine();
foreach (var detail in result1)
{
Console.writeline( " Customer: {0}, ",detail.Customer);
}
In this 4 or 5 length recordlines are treated as error line.
Thanks,
The text was updated successfully, but these errors were encountered: