459
questions
0
votes
0
answers
15
views
How to manage the throwing exception in the afterReadEvent
I'm using the FileHelpers library, version 3.1.5 from NuGet and am running into a problem while trying to use the AfterReadRecord event. When I throw an exception from this event, it's my ...
0
votes
1
answer
37
views
How to process CSV files with where some string fields have the CR character and the LF character
My class is
[IgnoreFirst(1)]
[DelimitedRecord("#")]
public class PrezElementi
{
public int idElemento { get; set; }
public string? Descrizione { get; set; }
}...
0
votes
0
answers
93
views
Read a character delimited text file with one header and multiple detail lines in C# efficiently
I need to read a character (^) delimited text file line by line and replace incorrect data in the same file. My current program does this, but I would like to know if there is a more efficient way to ...
0
votes
0
answers
48
views
Filehelpers: Class containing Dictionary to csv
I am trying to export csv file using FileHelpers engine.
The class has Dictionary property. Each dictionary key should be separate column in a csv file
e.g.
public class Customer
{
public int Id { ...
0
votes
1
answer
108
views
FileHelpers WriteStream writes no data
I need to read a fixed width file, map the records to another type and then write that data to a csv stream. I'm trying to use FileHelpers to do so but the WriteStream doesn't seem to write any data ...
1
vote
1
answer
33
views
Conversion of German character for file value to property not working
I am using file helper to convert the flat file data to an object. When the file contains the German character the value comes in the property with a question mark.
eg : File value is :- Rücksprache ...
0
votes
1
answer
37
views
How to reject a missing value in Filehelpers?
I am looking at using Filehelpers for parsing a CSV file. However, I need to reject entries that have missing values. This does not seem to be in the documentation which mentions only Nullable and ...
0
votes
1
answer
73
views
Fixed length to datatable
How to read fixed txt document to datable? (I'm using FileHelpers)
For example, I want results from List populate datatable:
Dim engine = New FixedFileEngine(Of Customer)()
Dim List As Customer() = ...
1
vote
1
answer
72
views
Parse a fixed width file with an array of objects?
Let's say I have a this fixed length string:
ABBCCC10purple crayon5 red pencil9 green marker
The A, B, and C fields are easily mapped:
[FixedLengthRecord]
public class OutterRecord
{
[...
1
vote
1
answer
51
views
Having issues with CSV files with columns that should be simply ignored, irregulat formating
We have a series of datafiles that are a rectangle of data that someone exports from Excel. Sometimes they export extra columns that are blank entirely. 1, 2, 15. We don't want those columns OR ...
0
votes
1
answer
86
views
File Helper library to resolve problem of CSV file with field having comma values in c# [duplicate]
I am using File Helper library in my .net core project to Parse CSV file to a class and i am getting error while doing so because one the field in the file have comma seperated value so i am unable ...
0
votes
2
answers
205
views
Filehelpers fixed size records can it ignore a single extra space/line-ending in some files?
Using FileHelpers FixedFileEngine to read in large files from customers. One customer seems to have an extra whitespace per record (perhaps lf/cf TBD).
BUT can I support this difference easily in the ...
3
votes
1
answer
82
views
Different header and footer FileHelpers
I am using the FileHelpers library to create a txt document which contains a list of employees, the document needs to be created with fixed size fields, I need to add a header and footer with a ...
2
votes
1
answer
49
views
Use of "RecordCondition.ExcludeIfMatchRegex"
Library version: v2.0.0.0
I would like to use ExcludeIfMatchRegex to exclude certain lines in the input file.
I have tested next code but the system is displaying the usual message error Object ...
2
votes
1
answer
106
views
FileHelpers not using correct Date format
I am attempting to parse records with a DateTime field, but FileHelpers is not using the format I am providing. The following is an F# script that should parse the records but throws an error. I ...
0
votes
1
answer
34
views
"AfterRead" event in the v2.0.0 version
My goal is to change the value of a field after it is read. And I think it is possible running the "AfterRead" event.
My current version of the library is 2.0.0.
I have tested the next ...
0
votes
1
answer
195
views
Any idea why private property and variable behave differently in FileHelpers?
To simplify the case, let say I have the following class
public class TestFileHelpersClass
{
[FieldOrder(1), FieldFixedLength(20), FieldTrim(TrimMode.Both)]
public string ...
-2
votes
1
answer
63
views
What's the "best practice" for when to create a FileHelpers engine?
I have a class in a Windows Forms application that is processing at peak 10 - 20 records per minute, but at non-peak it might go two or three hours without doing anything.
As I see it, you can ...
0
votes
1
answer
443
views
FileHelper reading in CSV where initial row specifies column names
For context I'm trying to parse in a 7dtd localization file. The contents of the file looks something akin to this:
Key,File,Type,UsedInMainMenu,NoTranslate,english,Context / Alternate Text,german,...
0
votes
1
answer
284
views
FileHelpers - Subclassing with FixedLengthRecords
I am working with a file which has multiple possible permutations of line format depending on an element subject to change. All permutations share length, the difference lies in elements being filled/...
0
votes
1
answer
129
views
Saving and Loading file definitions while using <generic> version of FileEngine
I've successfully use the SaveToXml and LoadFromXml methods on the ClassBuilder class to store and retrieve the file definitions while using the Standard version of the File Helper Engine.
However I'd ...
0
votes
0
answers
42
views
Why DataTable columns are read-only when loaded from CSV using FileHelpers? [duplicate]
Scenario 1 :
Loading datatable from SQL Server database is working fine.
I also can update data with no issues in that datatable:
SqlConnection conn = new SqlConnection(gDBConn);
SqlCommand cmd = new ...
5
votes
1
answer
788
views
How to make FileHelpers ignore columns after the defined columns? (i.e. ignore columns at the end)
Suppose I have the following FileHelpers Record definition:
[DelimitedRecord(",")]
[IgnoreEmptyLines]
public class TestRecord
{
[FieldCaption("A")]
[FieldQuoted(QuoteMode....
1
vote
1
answer
73
views
How do you use FileHelpers.engine with F# option types using generic converters?
This answer shows a nice way to use CsvHelper with generic F# option types. How do you do the same thing with FileHelpers?
I cannot figure out how to make the generic OptionConverter work. Consider ...
0
votes
1
answer
451
views
How do I append to a CSV file using Filehelpers with multiple record types that have distinct headers?
As the question says, using the FileHelpers library I am attempting to generate a CSV file along side a report file. The report file may have different (but finite) inputs/data structures and hence ...
0
votes
1
answer
307
views
Read delimited record containing delimited field with varying length with FileHelpers in C#?
I am using MultiRecordEngine() to read a delimited .txt file with no header and different type of records. The first two character of any record is the identifier which I am using to identify the type ...
0
votes
1
answer
288
views
Is there a way, for a C# application using FileHelpers library, to store and load the file structure class without compiling it in the executable? [closed]
I am thinking of something like a config, xml, or JSON file. But I have not found any such solution.
Perhaps FileHelpers doesn't have this functionality outside of the compiled assembly, but this is a ...
0
votes
1
answer
122
views
is there a way to create a 'Generic' CSV file format with FileHelpers
I would like to use FileHelpers to read a CSV file with an unknown file layout (except that it is comma delimited). I would basically like to have a string[] for row where each item is a field. Is ...
3
votes
1
answer
47
views
Problems with converting FixedLength format to to csv using same class definition
I defined both FixedLength and Delimited attributes on a single class. It reads the fixed length file fine but fails when i try to write out a csv.
[FixedLengthRecord]
[DelimitedRecord(",")]
...
0
votes
2
answers
1k
views
Write data to a .DAT file with Pipe Delimiter in .NET Core 2.1 version
I was using File Helpers .Net Framework. But when i started using .Net Core 2.1, File Helpers is not compatible. Can someone tell me an alternate was to write a pipe delimiter .Dat file.
Public class ...
-1
votes
3
answers
76
views
Filehelpers some columns are not written
I am writing this class to a file. But for some reason, some of the rows have some columns missing.
By this, I mean that some columns are shifted a few times to the left. I can see this on the last ...
0
votes
1
answer
287
views
How I can convert data format in filehelpers c#
I'm trying read this date 03/01/2020 00:17:41 from a .csv file, but when I try to convert to date with
[FieldConverter(ConverterKind.Date, "dd/MM/yyyy HH:mm:ss")]
public DateTime Field01_Fecha;
The ...
0
votes
2
answers
235
views
Last Delimiter in CSV file with FileHelpers
I must develop a CSV-Export with 57 columns.
After the last column i need the delimiter and then the LFCR.
Example:
Now i have
aaaa;bbbb;cccc;dddd
But i need
aaaa;bbbb;cccc;dddd;
Which ...
0
votes
1
answer
181
views
CSV Import with GUID failing
Looking for some quick help.
I am importing a CSV file that has 2 columns ID & Name. ID is a GUID and name is a String, as below:
c4f8da96-b991-457e-9fd5-94e532ffcd06,Location99
c4f8da96-b991-...
0
votes
1
answer
328
views
FileHelpers.ConvertException using format dd/MM/yy HH:mm
I have a column in CSV with value: 14/04/20 09:44
FECHA_FRANQUEO|ID_INCIDENCIA|CIF|PERSONA_CONTACTO
14/04/20 09:44|7093927|bbbbbbbbb|RAFA
14/04/20 09:02|7093933|aaaaaaaaa|Maria / Roger
I use ...
1
vote
0
answers
467
views
Can not read Excel File using NuGet FileHelpers.ExcelNPOIStorage
I have a problem with reading file using ExcelNPOIStorage.
Error Code:
System.MissingFieldException: 'Field not found: 'NPOI.SS.UserModel.MissingCellPolicy.CREATE_NULL_AS_BLANK'.'
Code:
var ...
0
votes
2
answers
178
views
Configuring FileHelpers DateTimeConverter format at runtime
I have a need to import a CSV file, but need my users to be able to select the date format their CSV file is using for dates.
Currently, I have my date property declared as
[FieldOrder(3)]
[...
0
votes
1
answer
327
views
How to use FileHelper library to get number of delimiters
Using the FileHelper Library Is there a way to get an exception if the record does not have expected number of delimiters in a line?
And another question is there is there a way to get an exception ...
1
vote
1
answer
238
views
how to call FileHelpers.RecordTypeSelector correctly?
I'm working with FileHelpers: https://www.filehelpers.net/
I have a source file which contains a set of approximately 10 different RecordTypes. To accommodate, I intend to use a MultiRecordEngine (...
1
vote
2
answers
280
views
ASP.net FileHelpers failed to convert string to datetime
I work on this issue since almost 2 days. Here is the error message:
FileHelpers.ConvertException: 'Error Converting '8/8/2018 8:48:52 AM'
to type: 'DateTime'. There are less chars in the Input ...
2
votes
1
answer
134
views
C#.NET: Read CSV using % converter
I'm reading a CSV file
Name,Score
Pat,99%
Chris,87%
and would like to discard the percent sign when the file is read through FileHelpers
using FileHelpers;
public class PctConverter : ...
0
votes
1
answer
807
views
How could I write to a file a dynamic object using FileHelpers?
I'm actually pursuing a way to create csv file which records could vary on type and order. They are defined by the user on both ways and I'm actually handling their types safely.
I loved using ...
0
votes
0
answers
132
views
how to limit writing a file using filehelpers C#
I need to manage a text file upto 3gb size. I'd like to keep the file under 3gb with new text being added to the end of the file and text at the beginning of the file being removed. I am experimenting ...
0
votes
1
answer
243
views
How do we read the last line of a csv file using filehelper class and then ignore the last line
How do we read the last line of a csv file using filehelper class and then ignore the last line. Or How do i ignore last line from csv file using filehelper then get the last line to a variable
...
-1
votes
1
answer
259
views
C# importing csv file into SQL database using FileHelpers
i'm trying to import a .csv file using the great FileHelpers library.
Doing some research most of the time i read that i should use BulkCopy to import the result into an SQL database table.
Could you ...
0
votes
1
answer
857
views
FileHelpers will only parse datetime if date string matches universal time format
My datetime field will only parse if the formatter is set to the universal time format and the date time is already in that format. Is this an expected behavior, or should it be able to take any ...
0
votes
2
answers
683
views
How to map a txt by column and line with FileHelpers lib
I'm wondering how could I get the column items from a txt file and write it on a output after formated.
This is my input.txt
DC 2INCL1 50000 20190802<
DC 2INCL2 50000 ...
0
votes
1
answer
360
views
Import CSV with Dynamic Columns
My Vendor is providing a CSV file where columns (names included on first line) are dynamic - meaning they will only appear if there is data in them and there is no guarantee on the order the columns ...
0
votes
0
answers
666
views
FileHelpers .Net library Error - delimeter found after the last field of the class
Visual Studio 2019, .Net Core 2.2 - getting the following error when debugging code to parse a csv file with 10 rows, using the FileHelpers .Net library:
{"Line: 2 Column: 593. Delimiter ',' found ...
1
vote
1
answer
80
views
Using the FileHelpers nuget package to read barcodes
Hello i'm using the FileHelpers nugets library to read from a barcode. Here's a sample of it :
(3102)011780(10)772890
and here is my filehelpers class :
class ReadBareCodes
{
[...