Questions tagged [filehelpers]
FileHelpers is a .net utility library to help applications manage flat file input and output.
454
questions
1
vote
1
answer
29
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
28
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
61
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
52
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
44
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
64
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
113
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
56
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
35
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
99
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
33
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
146
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
59
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
370
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
187
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
93
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
604
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
65
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
387
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
237
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
247
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
106
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
44
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
71
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
253
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
209
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
149
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
282
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
424
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
125
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
305
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 ...
0
votes
1
answer
205
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
259
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
120
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
719
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
114
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
210
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
218
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
732
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
582
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
298
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
547
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
59
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
{
[...
1
vote
1
answer
819
views
Read, modify and write using FileHelperAsyncEngine
I am new to FileHelper so bear with me.
I want to read an existing .csv file that has one of the columns with no data.
Next I want to populate that column from a db (the code attached is just putting ...
0
votes
1
answer
252
views
Sorting a List array and delete duplicate rows based on column values [closed]
I have a CSV file with about 40 columns. I use FileHelpers to read the file and extract a single column to perform additional operations later in the code.
The extracted list of string contains ...
0
votes
1
answer
212
views
C# filehelpers CSV DateTime exception on different system
So I got my program to do what I want, but it doesn't work on my work PC (Win 7).
When using compiled version from my home PC (Win 10) on work PC I'm
getting error "sequence has no elements" with all ...
2
votes
0
answers
156
views
Correct FIeldCoverter with date time format Filehelpers
I have a DateTime field which can be null so it needs to be left as a my question is though
[FieldConverter(typeof(NullableDateConverter))]
public DateTime? ItemNextAvailabilityDate;
How does ...
0
votes
1
answer
24
views
Cannot access lines based of header poco class
I am having the weirdest of errors.
Dim lines As List(Of NewOrderCsv) = (From record In _records Where record.Ticket2 = orderHeaderRow.Ticket2)
Their error is happening here on my declaration of the ...