-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.2.1 - Added new target frameworks (.NET 4.5.2, .NET 4.6.1).
Added Readme.md.
- Loading branch information
1 parent
998ee72
commit 70799dc
Showing
4 changed files
with
109 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# GenericParser | ||
|
||
GenericParser is a .NET implementation of a parser for delimited and fixed width format files. | ||
|
||
## Get Started | ||
|
||
Install the [latest Nuget package](https://www.nuget.org/packages/GenericParsing). | ||
|
||
Instantiate an instance of the parser: | ||
|
||
```csharp | ||
using (GenericParser parser = new GenericParser(filePath)) | ||
{ | ||
while (parser.Read()) | ||
{ | ||
string id = parser["ID"]; | ||
string name = parser["Name"]; | ||
string status = parser["Status"]; | ||
|
||
// Your code here ... | ||
} | ||
} | ||
``` | ||
|
||
See below for more examples. | ||
|
||
## GenericParser Features | ||
|
||
* Efficient | ||
* Excellent unit test coverage | ||
* Supports delimited and fixed-width formats | ||
* For delimited, any custom delimited of a single character is supported | ||
* Supports comment rows (single character marker) | ||
* Supports escape characters (single character only) | ||
* Supports a custom text qualifier to allow column/row delimiters to be ignored (e.g., multi-line data) | ||
* Supports escaped text qualifiers by doubling them up | ||
* Supports ignoring/including rows that contain no characters | ||
* Supports a header row | ||
* Supports the ability to dynamically add more columns to match the data | ||
* Supports the ability to enforce the number of columns to a specific number | ||
* Supports the ability to enforce the number of columns based on the first row | ||
* Supports trimming the strings of a column | ||
* Supports stripping off control characters | ||
* Supports reusing the same instance of the parser for different data sources | ||
* Supports TextReader and String (the file location) as data sources | ||
* Supports limiting the maximum number of rows to read | ||
* Supports customizing the size of the internal buffer | ||
* Supports skipping rows at the beginning of the data after the header row | ||
* Supports XML configuration to configure the parser | ||
* Supports access to data via column name (when a header row is supplied) | ||
* Supports Unicode encoding | ||
|
||
## GenericParserAdapter Features (Extends GenericParser) | ||
|
||
* Supports skipping rows at the end of the data | ||
* Supports adding a line number to each row | ||
* Supports the following outputs - XML, DataTable, and DataSet | ||
|
||
## GenericParser - Examples | ||
|
||
* Parsing file from disk | ||
|
||
```csharp | ||
using (GenericParser parser = new GenericParser(filePath)) | ||
{ | ||
while (parser.Read()) | ||
{ | ||
string id = parser["ID"]; | ||
|
||
// Your code here ... | ||
} | ||
} | ||
``` | ||
|
||
* Parsing file from stream | ||
|
||
```csharp | ||
using (GenericParser parser = new GenericParser(stream)) | ||
{ | ||
// ... | ||
} | ||
``` | ||
|
||
## GenericParserAdapter - Examples | ||
|
||
* Parsing file into a DataSet | ||
|
||
```csharp | ||
using (GenericParserAdapter parser = new GenericParserAdapter(filePath)) | ||
{ | ||
dsResult = parser.GetDataSet(); | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using System.Reflection; | ||
|
||
[assembly: AssemblyVersion("1.2.0.*")] | ||
[assembly: AssemblyFileVersion("1.2.0.0")] | ||
[assembly: AssemblyVersion("1.2.1.*")] | ||
[assembly: AssemblyFileVersion("1.2.1.0")] |