├── .gitattributes
├── .gitignore
├── CONTRIBUTING.md
├── GenericParsing.PerformanceTests
├── GenericParsing.PerformanceTests.csproj
├── Includes
│ ├── LumenWorks.Framework.IO.XML
│ ├── LumenWorks.Framework.IO.dll
│ └── VersionOneGenericParser.dll
├── PerformanceTests.cs
├── Properties
│ └── AssemblyInfo.cs
└── app.config
├── GenericParsing.UnitTests
├── GenericParsing.UnitTests.csproj
├── TestData
│ ├── AddingExtraColumns.out
│ ├── AddingExtraColumns.txt
│ ├── AddingExtraColumns.xml
│ ├── BasicEscapedCharacters.out
│ ├── BasicEscapedCharacters.txt
│ ├── BasicEscapedCharacters.xml
│ ├── BasicMaxRows.out
│ ├── BasicMaxRows.txt
│ ├── BasicMaxRows.xml
│ ├── BasicSkipRows.out
│ ├── BasicSkipRows.txt
│ ├── BasicSkipRows.xml
│ ├── BasicTextQualifiers.out
│ ├── BasicTextQualifiers.txt
│ ├── BasicTextQualifiers.xml
│ ├── ComplexDataDelimiter.out
│ ├── ComplexDataDelimiter.txt
│ ├── ComplexDataDelimiter.xml
│ ├── ComplexDataFixed.out
│ ├── ComplexDataFixed.txt
│ ├── ComplexDataFixed.xml
│ ├── DifferentColumnDelimiter.out
│ ├── DifferentColumnDelimiter.txt
│ ├── DifferentColumnDelimiter.xml
│ ├── EscapeWithoutTextQualifier.out
│ ├── EscapeWithoutTextQualifier.txt
│ ├── EscapeWithoutTextQualifier.xml
│ ├── EscapedCharacterAtEndOfFile.out
│ ├── EscapedCharacterAtEndOfFile.txt
│ ├── EscapedCharacterAtEndOfFile.xml
│ ├── EscapedCharacterAtEndOfRowDelimiter.out
│ ├── EscapedCharacterAtEndOfRowDelimiter.txt
│ ├── EscapedCharacterAtEndOfRowDelimiter.xml
│ ├── EscapedCharacterAtEndOfRowFixedWidth.out
│ ├── EscapedCharacterAtEndOfRowFixedWidth.txt
│ ├── EscapedCharacterAtEndOfRowFixedWidth.xml
│ ├── ExpectedColumnCountErrorAdding.out
│ ├── ExpectedColumnCountErrorAdding.txt
│ ├── ExpectedColumnCountErrorAdding.xml
│ ├── ExpectedColumnCountErrorRemoving.out
│ ├── ExpectedColumnCountErrorRemoving.txt
│ ├── ExpectedColumnCountErrorRemoving.xml
│ ├── FirstRowSetsExpectedColumnCountWithHeaderRow.out
│ ├── FirstRowSetsExpectedColumnCountWithHeaderRow.txt
│ ├── FirstRowSetsExpectedColumnCountWithHeaderRow.xml
│ ├── FirstRowSetsExpectedColumnCountWithHeaderRowError.out
│ ├── FirstRowSetsExpectedColumnCountWithHeaderRowError.txt
│ ├── FirstRowSetsExpectedColumnCountWithHeaderRowError.xml
│ ├── FirstRowSetsExpectedColumnCountWithoutHeaderRow.out
│ ├── FirstRowSetsExpectedColumnCountWithoutHeaderRow.txt
│ ├── FirstRowSetsExpectedColumnCountWithoutHeaderRow.xml
│ ├── FirstRowSetsExpectedColumnCountWithoutHeaderRowError.out
│ ├── FirstRowSetsExpectedColumnCountWithoutHeaderRowError.txt
│ ├── FirstRowSetsExpectedColumnCountWithoutHeaderRowError.xml
│ ├── HandlingDuplicateColumnNames.out
│ ├── HandlingDuplicateColumnNames.txt
│ ├── HandlingDuplicateColumnNames.xml
│ ├── IncludeLineNumber.out
│ ├── IncludeLineNumber.txt
│ ├── IncludeLineNumber.xml
│ ├── MaxRowsIgnoresCommentsHeader.out
│ ├── MaxRowsIgnoresCommentsHeader.txt
│ ├── MaxRowsIgnoresCommentsHeader.xml
│ ├── NotSkippingEmptyRowsDelimiter.out
│ ├── NotSkippingEmptyRowsDelimiter.txt
│ ├── NotSkippingEmptyRowsDelimiter.xml
│ ├── NotSkippingEmptyRowsDelimiterWithHeaderWithFileRowNumber.out
│ ├── NotSkippingEmptyRowsDelimiterWithHeaderWithFileRowNumber.txt
│ ├── NotSkippingEmptyRowsDelimiterWithHeaderWithFileRowNumber.xml
│ ├── NotSkippingEmptyRowsDelimiterWithHeaderWithoutFileRowNumber.out
│ ├── NotSkippingEmptyRowsDelimiterWithHeaderWithoutFileRowNumber.txt
│ ├── NotSkippingEmptyRowsDelimiterWithHeaderWithoutFileRowNumber.xml
│ ├── NotSkippingEmptyRowsDelimiterWithoutFileRowNumber.out
│ ├── NotSkippingEmptyRowsDelimiterWithoutFileRowNumber.txt
│ ├── NotSkippingEmptyRowsDelimiterWithoutFileRowNumber.xml
│ ├── NotSkippingEmptyRowsFixedWidth.out
│ ├── NotSkippingEmptyRowsFixedWidth.txt
│ ├── NotSkippingEmptyRowsFixedWidth.xml
│ ├── ReadLastRowWithRowDelimiter.out
│ ├── ReadLastRowWithRowDelimiter.txt
│ ├── ReadLastRowWithRowDelimiter.xml
│ ├── ReadLastRowWithoutRowDelimiter.out
│ ├── ReadLastRowWithoutRowDelimiter.txt
│ ├── ReadLastRowWithoutRowDelimiter.xml
│ ├── ReadingInHeader.out
│ ├── ReadingInHeader.txt
│ ├── ReadingInHeader.xml
│ ├── ReadingInHeaderAfterComments.out
│ ├── ReadingInHeaderAfterComments.txt
│ ├── ReadingInHeaderAfterComments.xml
│ ├── RowWithoutColumnDelimiter.out
│ ├── RowWithoutColumnDelimiter.txt
│ ├── RowWithoutColumnDelimiter.xml
│ ├── SimpleDelimiter.out
│ ├── SimpleDelimiter.txt
│ ├── SimpleDelimiter.xml
│ ├── SimpleDelimiterWithControlCharacters.out
│ ├── SimpleDelimiterWithControlCharacters.txt
│ ├── SimpleDelimiterWithControlCharacters.xml
│ ├── SimpleFixedWidth.out
│ ├── SimpleFixedWidth.txt
│ ├── SimpleFixedWidth.xml
│ ├── SkippingAllRows.out
│ ├── SkippingAllRows.txt
│ ├── SkippingAllRows.xml
│ ├── SkippingBeginningAndEndingRows.out
│ ├── SkippingBeginningAndEndingRows.txt
│ ├── SkippingBeginningAndEndingRows.xml
│ ├── SkippingBeginningAndEndingRowsAll.out
│ ├── SkippingBeginningAndEndingRowsAll.txt
│ ├── SkippingBeginningAndEndingRowsAll.xml
│ ├── SkippingComments.out
│ ├── SkippingComments.txt
│ ├── SkippingComments.xml
│ ├── SkippingEmptyRowsWithDelimiter.out
│ ├── SkippingEmptyRowsWithDelimiter.txt
│ ├── SkippingEmptyRowsWithDelimiter.xml
│ ├── SkippingEmptyRowsWithFixedWidth.out
│ ├── SkippingEmptyRowsWithFixedWidth.txt
│ ├── SkippingEmptyRowsWithFixedWidth.xml
│ ├── SkippingEndingRows.out
│ ├── SkippingEndingRows.txt
│ ├── SkippingEndingRows.xml
│ ├── SkippingEndingRowsAll.out
│ ├── SkippingEndingRowsAll.txt
│ ├── SkippingEndingRowsAll.xml
│ ├── SkippingEndingRowsExactlyAll.out
│ ├── SkippingEndingRowsExactlyAll.txt
│ ├── SkippingEndingRowsExactlyAll.xml
│ ├── SkippingRowsAtEndOfBuffer.out
│ ├── SkippingRowsAtEndOfBuffer.txt
│ ├── SkippingRowsAtEndOfBuffer.xml
│ ├── TextQualifierBeginningAndEnd.out
│ ├── TextQualifierBeginningAndEnd.txt
│ ├── TextQualifierBeginningAndEnd.xml
│ ├── TextQualifierNotClosedAtEnd.out
│ ├── TextQualifierNotClosedAtEnd.txt
│ ├── TextQualifierNotClosedAtEnd.xml
│ ├── TextQualifierWithoutEscape.out
│ ├── TextQualifierWithoutEscape.txt
│ ├── TextQualifierWithoutEscape.xml
│ ├── TextQualifiersWithDelimiters.out
│ ├── TextQualifiersWithDelimiters.txt
│ ├── TextQualifiersWithDelimiters.xml
│ ├── TrimmingResults.out
│ ├── TrimmingResults.txt
│ ├── TrimmingResults.xml
│ ├── UnicodeSupported.out
│ ├── UnicodeSupported.txt
│ ├── UnicodeSupported.xml
│ ├── XmlTest.out
│ ├── XmlTest.txt
│ └── XmlTest.xml
└── UnitTests.cs
├── GenericParsing.sln
├── GenericParsing.vsmdi
├── GenericParsing
├── FieldType.cs
├── GenericParser.cs
├── GenericParserAdapter.cs
├── GenericParsing.csproj
├── GenericParsing.shfbproj
├── Help
│ ├── GenericParsing.chm
│ └── GenericParsing.mshc
├── ParserState.cs
└── ParsingException.cs
├── LICENSE.md
├── Performance Results
├── 1000000_Rows.txt
├── 100000_Rows.txt
├── 10000_Rows.txt
├── 1000_Rows.txt
├── 100_Rows.txt
├── 10_Rows.txt
├── 50000_Rows.txt
└── Performance Tests.xlsx
├── README.md
└── SolutionVersionInfo.cs
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
2 | [Bb]in/
3 | [Oo]bj/
4 |
5 | # mstest test results
6 | TestResults
7 |
8 | ## Ignore Visual Studio temporary files, build results, and
9 | ## files generated by popular Visual Studio add-ons.
10 |
11 | # User-specific files
12 | *.suo
13 | *.user
14 | *.sln.docstates
15 |
16 | # Build results
17 | [Dd]ebug/
18 | [Rr]elease/
19 | x64/
20 | *_i.c
21 | *_p.c
22 | *.ilk
23 | *.meta
24 | *.obj
25 | *.pch
26 | *.pdb
27 | *.pgc
28 | *.pgd
29 | *.rsp
30 | *.sbr
31 | *.tlb
32 | *.tli
33 | *.tlh
34 | *.tmp
35 | *.log
36 | *.vspscc
37 | *.vssscc
38 | .builds
39 |
40 | # Visual C++ cache files
41 | ipch/
42 | *.aps
43 | *.ncb
44 | *.opensdf
45 | *.sdf
46 |
47 | # Visual Studio profiler
48 | *.psess
49 | *.vsp
50 | *.vspx
51 |
52 | # Guidance Automation Toolkit
53 | *.gpState
54 |
55 | # ReSharper is a .NET coding add-in
56 | _ReSharper*
57 |
58 | # NCrunch
59 | *.ncrunch*
60 | .*crunch*.local.xml
61 |
62 | # Installshield output folder
63 | [Ee]xpress
64 |
65 | # DocProject is a documentation generator add-in
66 | DocProject/buildhelp/
67 | DocProject/Help/*.HxT
68 | DocProject/Help/*.HxC
69 | DocProject/Help/*.hhc
70 | DocProject/Help/*.hhk
71 | DocProject/Help/*.hhp
72 | DocProject/Help/Html2
73 | DocProject/Help/html
74 |
75 | # Click-Once directory
76 | publish
77 |
78 | # Publish Web Output
79 | *.Publish.xml
80 |
81 | # NuGet Packages Directory
82 | packages
83 |
84 | # Windows Azure Build Output
85 | csx
86 | *.build.csdef
87 |
88 | # Others
89 | [Bb]in
90 | [Oo]bj
91 | sql
92 | TestResults
93 | [Tt]est[Rr]esult*
94 | *.Cache
95 | ClientBin
96 | [Ss]tyle[Cc]op.*
97 | ~$*
98 | *.dbmdl
99 | Generated_Code #added for RIA/Silverlight projects
100 |
101 | # Backup & report files from converting an old project file to a newer
102 | # Visual Studio version. Backup files are not needed, because we have git ;-)
103 | _UpgradeReport_Files/
104 | Backup*/
105 | UpgradeLog*.XML
106 |
107 | .vs/
108 | GenericParsing/GenericParsing.snk
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to GenericParsing
2 | Thanks for your interest in contributing to this project. It was a labor of love that I'm glad others have found useful.
3 |
4 | ## Github
5 | The code is hosted out of Github. All issues and changes should start and end here.
6 |
7 | ## [Github Flow](https://guides.github.com/introduction/flow/index.html)
8 | Pull requests are the best way to propose changes to the codebase (please leverage [Github Flow](https://guides.github.com/introduction/flow/index.html)). Pull requests are welcome:
9 |
10 | 1. Fork the repo.
11 | 2. Create your branch from `master`.
12 | 3. Add tests, if you've added new features.
13 | 4. If the API has changed, update the documentation.
14 | 5. Ensure all tests pass.
15 | 6. Issue that pull request!
16 |
17 | ## Report bugs using Github
18 | We use GitHub issues to track public bugs.
19 |
20 | ## License
21 | By contributing, you agree that your contributions will be licensed under the [MIT License](http://choosealicense.com/licenses/mit/).
--------------------------------------------------------------------------------
/GenericParsing.PerformanceTests/GenericParsing.PerformanceTests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Local
5 | 8.0.50727
6 | 2.0
7 | {28A4801F-B624-4AED-9765-B172203EB188}
8 | Debug
9 | AnyCPU
10 |
11 |
12 |
13 |
14 | GenericParsing.PerformanceTests
15 |
16 |
17 | JScript
18 | Grid
19 | IE50
20 | false
21 | Exe
22 | GenericParsing.PerformanceTests
23 | OnBuildSuccess
24 |
25 |
26 |
27 |
28 |
29 |
30 | v4.8
31 | 2.0
32 | publish\
33 | true
34 | Disk
35 | false
36 | Foreground
37 | 7
38 | Days
39 | false
40 | false
41 | true
42 | 0
43 | 1.0.0.%2a
44 | false
45 | false
46 | true
47 |
48 |
49 |
50 | bin\Debug\
51 | false
52 | 285212672
53 | false
54 |
55 |
56 | DEBUG;TRACE
57 |
58 |
59 | true
60 | 4096
61 | false
62 |
63 |
64 | false
65 | false
66 | false
67 | false
68 | 4
69 | full
70 | prompt
71 | AllRules.ruleset
72 | false
73 |
74 |
75 | bin\Release\
76 | false
77 | 285212672
78 | false
79 |
80 |
81 | TRACE
82 |
83 |
84 | false
85 | 4096
86 | false
87 |
88 |
89 | true
90 | false
91 | false
92 | false
93 | 4
94 | none
95 | prompt
96 | AllRules.ruleset
97 | false
98 |
99 |
100 |
101 | False
102 | Includes\LumenWorks.Framework.IO.dll
103 |
104 |
105 |
106 | System
107 |
108 |
109 | System.Data
110 |
111 |
112 | System.XML
113 |
114 |
115 | False
116 | Includes\VersionOneGenericParser.dll
117 |
118 |
119 |
120 |
121 |
122 | Code
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 | False
131 | .NET Framework 3.5 SP1 Client Profile
132 | false
133 |
134 |
135 | False
136 | .NET Framework 3.5 SP1
137 | true
138 |
139 |
140 | False
141 | Windows Installer 3.1
142 | true
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 | {3e34d5eb-b746-4672-aa9d-f73807a59390}
151 | GenericParsing
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
--------------------------------------------------------------------------------
/GenericParsing.PerformanceTests/Includes/LumenWorks.Framework.IO.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndrewRissing/GenericParsing/6ef9b494c2f1cef387721cf41d4e6e952ea9fa9f/GenericParsing.PerformanceTests/Includes/LumenWorks.Framework.IO.dll
--------------------------------------------------------------------------------
/GenericParsing.PerformanceTests/Includes/VersionOneGenericParser.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndrewRissing/GenericParsing/6ef9b494c2f1cef387721cf41d4e6e952ea9fa9f/GenericParsing.PerformanceTests/Includes/VersionOneGenericParser.dll
--------------------------------------------------------------------------------
/GenericParsing.PerformanceTests/PerformanceTests.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndrewRissing/GenericParsing/6ef9b494c2f1cef387721cf41d4e6e952ea9fa9f/GenericParsing.PerformanceTests/PerformanceTests.cs
--------------------------------------------------------------------------------
/GenericParsing.PerformanceTests/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndrewRissing/GenericParsing/6ef9b494c2f1cef387721cf41d4e6e952ea9fa9f/GenericParsing.PerformanceTests/Properties/AssemblyInfo.cs
--------------------------------------------------------------------------------
/GenericParsing.PerformanceTests/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/AddingExtraColumns.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1
4 | 2
5 | 3
6 |
7 |
8 | g
9 | h
10 | i
11 | j
12 | k
13 | l
14 |
15 |
16 | 7
17 | 8
18 | 9
19 | 10
20 | 11
21 | 12
22 |
23 |
24 | m
25 | n
26 | o
27 | p
28 | q
29 | r
30 |
31 |
32 | 13
33 | 14
34 | 15
35 | 16
36 | 17
37 | 18
38 |
39 |
40 | t
41 | u
42 | v
43 | w
44 | x
45 | y
46 |
47 |
48 | 19
49 | 20
50 | 21
51 | 22
52 | 23
53 | 24
54 |
55 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/AddingExtraColumns.txt:
--------------------------------------------------------------------------------
1 | a,b,c
2 | 1,2,3
3 | g,h,i,j,k,l
4 | 7,8,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/AddingExtraColumns.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | True
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/BasicEscapedCharacters.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a"
4 | b
5 | c
6 | d
7 | e
8 | f
9 |
10 |
11 | 1
12 | 2
13 | 3
14 | 4
15 | 5
16 | 6
17 |
18 |
19 | g
20 | h
21 | i
22 | j
23 | k
24 | l
25 |
26 |
27 | 7
28 | 8
29 | ,9
30 | 10
31 | 11
32 | 12
33 |
34 |
35 | m
36 | n
37 | o
38 | p
39 | q
40 | r
41 |
42 |
43 | 13
44 | 14
45 | 15
46 | 16
47 | 17
48 | 18
49 |
50 |
51 | t
52 | u
53 | v
54 | w
55 | x
56 | \vy
57 |
58 |
59 | 19
60 | 20
61 | 21
62 | 22
63 | 23
64 | 24"
65 |
66 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/BasicEscapedCharacters.txt:
--------------------------------------------------------------------------------
1 | "a\"",b,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7,8,\,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,\\\vy
8 | 19,20,21,22,23,24\"
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/BasicEscapedCharacters.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 92
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/BasicMaxRows.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a
4 | b
5 | c
6 | d
7 | e
8 | f
9 |
10 |
11 | 1
12 | 2
13 | 3
14 | 4
15 | 5
16 | 6
17 |
18 |
19 | g
20 | h
21 | i
22 | j
23 | k
24 | l
25 |
26 |
27 | 7
28 | 8
29 | 9
30 | 10
31 | 11
32 | 12
33 |
34 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/BasicMaxRows.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7,8,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/BasicMaxRows.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 4
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/BasicSkipRows.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | g
4 | h
5 | i
6 | j
7 | k
8 | l
9 |
10 |
11 | 7
12 | 8
13 | 9
14 | 10
15 | 11
16 | 12
17 |
18 |
19 | m
20 | n
21 | o
22 | p
23 | q
24 | r
25 |
26 |
27 | 13
28 | 14
29 | 15
30 | 16
31 | 17
32 | 18
33 |
34 |
35 | t
36 | u
37 | v
38 | w
39 | x
40 | y
41 |
42 |
43 | 19
44 | 20
45 | 21
46 | 22
47 | 23
48 | 24
49 |
50 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/BasicSkipRows.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7,8,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/BasicSkipRows.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 2
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/BasicTextQualifiers.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a
4 | b
5 | c
6 | d
7 | e
8 | f
9 |
10 |
11 | 1
12 | 2
13 | 3
14 | 4
15 | 5
16 | 6
17 |
18 |
19 | g
20 | h
21 | i
22 | j
23 | k
24 | l
25 |
26 |
27 | 7
28 | 8
29 | 9
30 | 10
31 | 11
32 | 12
33 |
34 |
35 | m
36 | n
37 | o
38 | p
39 | q
40 | r
41 |
42 |
43 | 13
44 | 14
45 | 15
46 | 16
47 | 17
48 | 18
49 |
50 |
51 | t
52 | u
53 | v
54 | w
55 | x
56 | y
57 |
58 |
59 | 19
60 | 20
61 | 21
62 | 22
63 | 23
64 | 24
65 |
66 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/BasicTextQualifiers.txt:
--------------------------------------------------------------------------------
1 | "a","b ",c," d",e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7," 8 ",9,10,11,12
5 | m,n,o,p,q," r"
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | "19 ",20,21,22,23," 24"
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/BasicTextQualifiers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ComplexDataDelimiter.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | g
4 | h
5 | i
6 | j
7 | k
8 | l
9 |
10 |
11 | 7
12 | 8
13 | 9-a number
14 | 10
15 | 11
16 | 12
17 |
18 |
19 | m
20 | n
21 | o
22 | p
23 | q
24 | r
25 |
26 |
27 | 13
28 | 14
29 | 15
30 | 16
31 | 17
32 | 18
33 |
34 |
35 | tt
36 | u
37 | v
38 | w
39 | x
40 | y
41 |
42 |
43 | 19
44 | 20
45 | 21
46 | 22
47 | 23
48 | 24
49 |
50 |
51 | a
52 | b
53 | c
54 | d
55 | e
56 | f
57 |
58 |
59 | 1
60 | 2
61 | 3
62 | 4
63 | 5
64 | 6\
65 |
66 |
67 | g
68 | h
69 | i
70 | j
71 | k
72 | l
73 |
74 |
75 | 7
76 | 8
77 | 9
78 | 10
79 | 11
80 | 12
81 |
82 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ComplexDataDelimiter.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 | #This is a comment
4 | a,b,c,d
5 | a,b,c,"\"d",e,"f
6 | , "
7 | 1,2,3,4,5,6
8 | #This is a comment
9 | # This is a comment
10 | g,h,i,j,k,l
11 | 7,8,\9-a number,10,11,12
12 | m,n,o,p,q,r
13 |
14 | #This is a comment
15 |
16 |
17 | 13,14,15,16,17,18
18 | \tt,u,v,w,x,y
19 |
20 | #This is a comment
21 | 19,20,21,22,23,24
22 |
23 | a,b,c,d,e,f
24 | 1,2,3,4,5,6\\
25 | g,h,i,j,k,l
26 | 7,8,9,10,11,12
27 |
28 | a,b,c,d,e,f
29 | 1,2,3,4,5,6
30 | g,h,i,j,k,l
31 | 7,8,9,10,11,12
32 | a,b,c,d,e,f
33 | 1,2,3,4,5,6
34 | g,h,i,j,k,l
35 | 7,8,9,10,11,12
36 | a,b,c,d,e,f
37 | 1,2,3,4,5,6
38 | g,h,i,j,k,l
39 | 7,8,9,10,11,12
40 |
41 |
42 |
43 | #This is a comment
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ComplexDataDelimiter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 50
4 | 10
5 | 2
6 | 0
7 | True
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 92
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ComplexDataFixed.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a
4 | b
5 | c
6 |
7 |
8 | a
9 | b\\
10 | c
11 |
12 |
13 | a
14 | b
15 | c
16 |
17 |
18 | 5
19 | 6
20 | 7
21 |
22 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ComplexDataFixed.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 | # This is a comment row...
4 | defghijklmno
5 | " a"b\" c
6 |
7 | a b c
8 | 1 2 3
9 |
10 | #Another comment...
11 |
12 | a b c
13 | a b\\ c
14 |
15 | #Another comment...
16 | a b c
17 | 5 6 7
18 | a b c
19 | 8 6 a
20 |
21 | #Another comment...
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ComplexDataFixed.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 4
5 | 4
6 | 4
7 |
8 | 50
9 | 4
10 | 3
11 | 3
12 | True
13 | False
14 | False
15 | True
16 | FixedWidth
17 | False
18 | 34
19 | 92
20 | 35
21 | False
22 | 0
23 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/DifferentColumnDelimiter.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a
4 | b
5 | c
6 | d
7 | e
8 | f
9 |
10 |
11 | 1
12 | 2
13 | 3
14 | 4
15 | 5
16 | 6
17 |
18 |
19 | g
20 | h
21 | i
22 | j
23 | k
24 | l
25 |
26 |
27 | 7
28 | 8
29 | 9
30 | 10
31 | 11
32 | 12
33 |
34 |
35 | m
36 | n
37 | o
38 | p
39 | q
40 | r
41 |
42 |
43 | 13
44 | 14
45 | 15
46 | 16
47 | 17
48 | 18
49 |
50 |
51 | t
52 | u
53 | v
54 | w
55 | x
56 | y
57 |
58 |
59 | 19
60 | 20
61 | 21
62 | 22
63 | 23
64 | 24
65 |
66 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/DifferentColumnDelimiter.txt:
--------------------------------------------------------------------------------
1 | a|b|c|d|e|f
2 | 1|2|3|4|5|6
3 | g|h|i|j|k|l
4 | 7|8|9|10|11|12
5 | m|n|o|p|q|r
6 | 13|14|15|16|17|18
7 | t|u|v|w|x|y
8 | 19|20|21|22|23|24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/DifferentColumnDelimiter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 124
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/EscapeWithoutTextQualifier.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a\
4 | b
5 | c
6 | d
7 | e
8 | f
9 |
10 |
11 | 1
12 | 2
13 | 3
14 | 4
15 | 5
16 | 6
17 |
18 |
19 | g
20 | h
21 | i
22 | j
23 | k
24 | l
25 |
26 |
27 | 7
28 | 8
29 | ,9
30 | 10
31 | 11
32 | 12
33 |
34 |
35 | m
36 | n
37 | o
38 | p
39 | q
40 | r
41 |
42 |
43 | 13
44 | 14
45 | 15
46 | 16
47 | 17
48 | 18
49 |
50 |
51 | t
52 | u
53 | v
54 | w
55 | x
56 | \vy
57 |
58 |
59 | 19
60 | 20
61 | 21
62 | 22
63 | 23
64 | 24\
65 |
66 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/EscapeWithoutTextQualifier.txt:
--------------------------------------------------------------------------------
1 | a\\,b,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7,8,\,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,\\\vy
8 | 19,20,21,22,23,24\\
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/EscapeWithoutTextQualifier.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 92
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/EscapedCharacterAtEndOfFile.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a"
4 | b
5 | c
6 | d
7 | e
8 | f
9 |
10 |
11 | 1
12 | 2
13 | 3
14 | 4
15 | 5
16 | 6
17 |
18 |
19 | g
20 | h
21 | i
22 | j
23 | k
24 | l
25 |
26 |
27 | 7
28 | 8
29 | ,9
30 | 10
31 | 11
32 | 12
33 |
34 |
35 | m
36 | n
37 | o
38 | p
39 | q
40 | r
41 |
42 |
43 | 13
44 | 14
45 | 15
46 | 16
47 | 17
48 | 18
49 |
50 |
51 | t
52 | u
53 | v
54 | w
55 | x
56 | \vy
57 |
58 |
59 | 19
60 | 20
61 | 21
62 | 22
63 | 23
64 | 24
65 |
66 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/EscapedCharacterAtEndOfFile.txt:
--------------------------------------------------------------------------------
1 | "a\"",b,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7,8,\,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,\\\vy
8 | 19,20,21,22,23,24\
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/EscapedCharacterAtEndOfFile.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 92
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/EscapedCharacterAtEndOfRowDelimiter.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a
4 | b
5 | c
6 | d
7 | e
8 | f
9 |
10 |
11 | 1
12 | 2
13 | 3
14 | 4
15 | 5
16 | 6
17 |
18 |
19 | g
20 | h
21 | i
22 | j
23 | k
24 | l
25 |
26 |
27 | 7
28 | 8
29 | 9
30 | 10
31 | 11
32 | 12
33 |
34 |
35 | m
36 | n
37 | o
38 | p
39 | q
40 | r
41 |
42 |
43 | 13
44 | 14
45 | 15
46 | 16
47 | 17
48 | 18
49 |
50 |
51 | t
52 | u
53 | v
54 | w
55 | x
56 | y
57 |
58 |
59 | 19
60 | 20
61 | 21
62 | 22
63 | 23
64 | 24
65 |
66 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/EscapedCharacterAtEndOfRowDelimiter.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l\
4 | 7,8,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/EscapedCharacterAtEndOfRowDelimiter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 92
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/EscapedCharacterAtEndOfRowFixedWidth.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a
4 | b
5 |
6 |
7 | 1
8 | 2
9 |
10 |
11 | g
12 | h
13 |
14 |
15 | 7
16 | 8
17 |
18 |
19 | m
20 | n\
21 |
22 |
23 | 1
24 | 1
25 |
26 |
27 | t
28 | u
29 |
30 |
31 | 1
32 | 2
33 |
34 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/EscapedCharacterAtEndOfRowFixedWidth.txt:
--------------------------------------------------------------------------------
1 | a b
2 | 1 2
3 | g h
4 | 7 8
5 | m n\
6 | 1 1
7 | t u
8 | 1 2
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/EscapedCharacterAtEndOfRowFixedWidth.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2
5 | 2
6 |
7 | 1024
8 | 0
9 | 0
10 | 2
11 | False
12 | False
13 | False
14 | True
15 | FixedWidth
16 | False
17 | 34
18 | 92
19 | 35
20 | False
21 | 0
22 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ExpectedColumnCountErrorAdding.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a
4 | b
5 | c
6 | d
7 | e
8 | f
9 |
10 |
11 | 1
12 | 2
13 | 3
14 | 4
15 | 5
16 | 6
17 |
18 |
19 | g
20 | h
21 | i
22 | j
23 | k
24 | l
25 | m
26 | n
27 | o
28 |
29 |
30 | 7
31 | 8
32 | 9
33 | 10
34 | 11
35 | 12
36 |
37 |
38 | m
39 | n
40 | o
41 | p
42 | q
43 | r
44 |
45 |
46 | 13
47 | 14
48 | 15
49 | 16
50 | 17
51 | 18
52 |
53 |
54 | t
55 | u
56 | v
57 | w
58 | x
59 | y
60 |
61 |
62 | 19
63 | 20
64 | 21
65 | 22
66 | 23
67 | 24
68 |
69 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ExpectedColumnCountErrorAdding.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l,m,n,o
4 | 7,8,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ExpectedColumnCountErrorAdding.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 6
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ExpectedColumnCountErrorRemoving.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a
4 | b
5 | c
6 | d
7 | e
8 | f
9 |
10 |
11 | 1
12 | 2
13 | 3
14 | 4
15 | 5
16 | 6
17 |
18 |
19 | g
20 | h
21 | i
22 | j
23 |
24 |
25 | 7
26 | 8
27 | 9
28 | 10
29 | 11
30 | 12
31 |
32 |
33 | m
34 | n
35 | o
36 | p
37 | q
38 | r
39 |
40 |
41 | 13
42 | 14
43 | 15
44 | 16
45 | 17
46 | 18
47 |
48 |
49 | t
50 | u
51 | v
52 | w
53 | x
54 | y
55 |
56 |
57 | 19
58 | 20
59 | 21
60 | 22
61 | 23
62 | 24
63 |
64 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ExpectedColumnCountErrorRemoving.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j
4 | 7,8,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ExpectedColumnCountErrorRemoving.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 6
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/FirstRowSetsExpectedColumnCountWithHeaderRow.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1
4 | 2
5 | 3
6 | 4
7 | 5
8 | 6
9 |
10 |
11 | g
12 | h
13 | i
14 | j
15 | k
16 | l
17 |
18 |
19 | 7
20 | 8
21 | 9
22 | 10
23 | 11
24 | 12
25 |
26 |
27 | m
28 | n
29 | o
30 | p
31 | q
32 | r
33 |
34 |
35 | 13
36 | 14
37 | 15
38 | 16
39 | 17
40 | 18
41 |
42 |
43 | t
44 | u
45 | v
46 | w
47 | x
48 | y
49 |
50 |
51 | 19
52 | 20
53 | 21
54 | 22
55 | 23
56 | 24
57 |
58 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/FirstRowSetsExpectedColumnCountWithHeaderRow.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7,8,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/FirstRowSetsExpectedColumnCountWithHeaderRow.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | True
8 | False
9 | False
10 | True
11 | Delimited
12 | True
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/FirstRowSetsExpectedColumnCountWithHeaderRowError.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1
4 | 2
5 | 3
6 | 4
7 | 5
8 | 6
9 |
10 |
11 | g
12 | h
13 | i
14 | j
15 | k
16 | l
17 |
18 |
19 | 7
20 | 8
21 | 9
22 | 10
23 | 11
24 | 12
25 |
26 |
27 | m
28 | n
29 | o
30 | p
31 | q
32 | r
33 |
34 |
35 | 13
36 | 14
37 | 15
38 | 16
39 | 17
40 | 18
41 |
42 |
43 | t
44 | u
45 | v
46 | w
47 | x
48 | y
49 |
50 |
51 | 19
52 | 20
53 | 21
54 | 22
55 | 23
56 | 24
57 |
58 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/FirstRowSetsExpectedColumnCountWithHeaderRowError.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f,Error
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7,8,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/FirstRowSetsExpectedColumnCountWithHeaderRowError.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | True
8 | False
9 | False
10 | True
11 | Delimited
12 | True
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/FirstRowSetsExpectedColumnCountWithoutHeaderRow.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1
4 | 2
5 | 3
6 | 4
7 | 5
8 | 6
9 |
10 |
11 | g
12 | h
13 | i
14 | j
15 | k
16 | l
17 |
18 |
19 | 7
20 | 8
21 | 9
22 | 10
23 | 11
24 | 12
25 |
26 |
27 | m
28 | n
29 | o
30 | p
31 | q
32 | r
33 |
34 |
35 | 13
36 | 14
37 | 15
38 | 16
39 | 17
40 | 18
41 |
42 |
43 | t
44 | u
45 | v
46 | w
47 | x
48 | y
49 |
50 |
51 | 19
52 | 20
53 | 21
54 | 22
55 | 23
56 | 24
57 |
58 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/FirstRowSetsExpectedColumnCountWithoutHeaderRow.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7,8,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/FirstRowSetsExpectedColumnCountWithoutHeaderRow.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 1
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | True
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/FirstRowSetsExpectedColumnCountWithoutHeaderRowError.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a
4 | b
5 | c
6 | d
7 | e
8 | f
9 |
10 |
11 | 1
12 | 2
13 | 3
14 | 4
15 | 5
16 | 6
17 |
18 |
19 | g
20 | h
21 | i
22 | j
23 | k
24 | l
25 |
26 |
27 | 7
28 | 8
29 | 9
30 | 10
31 | 11
32 | 12
33 |
34 |
35 | m
36 | n
37 | o
38 | p
39 | q
40 | r
41 |
42 |
43 | 13
44 | 14
45 | 15
46 | 16
47 | 17
48 | 18
49 |
50 |
51 | t
52 | u
53 | v
54 | w
55 | x
56 | y
57 |
58 |
59 | 19
60 | 20
61 | 21
62 | 22
63 | 23
64 | 24
65 |
66 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/FirstRowSetsExpectedColumnCountWithoutHeaderRowError.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7,8,9,10,11,12,
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/FirstRowSetsExpectedColumnCountWithoutHeaderRowError.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | True
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/HandlingDuplicateColumnNames.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1
4 | 2
5 | 3
6 | 4
7 | 5
8 | 6
9 |
10 |
11 | g
12 | h
13 | i
14 | j
15 | k
16 | l
17 |
18 |
19 | 7
20 | 8
21 | 9
22 | 10
23 | 11
24 | 12
25 |
26 |
27 | m
28 | n
29 | o
30 | p
31 | q
32 | r
33 |
34 |
35 | 13
36 | 14
37 | 15
38 | 16
39 | 17
40 | 18
41 |
42 |
43 | t
44 | u
45 | v
46 | w
47 | x
48 | y
49 |
50 |
51 | 19
52 | 20
53 | 21
54 | 22
55 | 23
56 | 24
57 |
58 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/HandlingDuplicateColumnNames.txt:
--------------------------------------------------------------------------------
1 | a,b,a,b,e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7,8,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/HandlingDuplicateColumnNames.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | True
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/IncludeLineNumber.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | 3
4 | 1
5 | 2
6 | 3
7 | 4
8 | 5
9 | 6
10 |
11 |
12 | 4
13 | g
14 | h
15 | i
16 | j
17 | k
18 | l
19 |
20 |
21 | 5
22 | 7
23 | 8
24 | 9
25 | 10
26 | 11
27 | 12
28 |
29 |
30 | 7
31 | m
32 | n
33 | o
34 | p
35 | q
36 | r
37 |
38 |
39 | 8
40 | 13
41 | 14
42 | 15
43 | 16
44 | 17
45 | 18
46 |
47 |
48 | 9
49 | t
50 | u
51 | v
52 | w
53 | x
54 | y
55 |
56 |
57 | 10
58 | 19
59 | 20
60 | 21
61 | 22
62 | 23
63 | 24
64 |
65 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/IncludeLineNumber.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 | #Comment #1
3 | 1,2,3,4,5,6
4 | g,h,i,j,k,l
5 | 7,8,9,10,11,12
6 | #Comment #2
7 | m,n,o,p,q,r
8 | 13,14,15,16,17,18
9 | t,u,v,w,x,y
10 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/IncludeLineNumber.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | True
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | True
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/MaxRowsIgnoresCommentsHeader.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1
4 | 2
5 | 3
6 | 4
7 | 5
8 | 6
9 |
10 |
11 | g
12 | h
13 | i
14 | j
15 | k
16 | l
17 |
18 |
19 | 7
20 | 8
21 | 9
22 | 10
23 | 11
24 | 12
25 |
26 |
27 | m
28 | n
29 | o
30 | p
31 | q
32 | r
33 |
34 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/MaxRowsIgnoresCommentsHeader.txt:
--------------------------------------------------------------------------------
1 | #This shouldn't cause any problems
2 | # I can only test it to see....
3 | a,b,c,d,e,f
4 | 1,2,3,4,5,6
5 | g,h,i,j,k,l
6 | #Another comment in the middle.
7 | 7,8,9,10,11,12
8 | m,n,o,p,q,r
9 | 13,14,15,16,17,18
10 | t,u,v,w,x,y
11 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/MaxRowsIgnoresCommentsHeader.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 4
5 | 0
6 | 0
7 | True
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/NotSkippingEmptyRowsDelimiter.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1
4 | a
5 | b
6 | c
7 | d
8 | e
9 | f
10 |
11 |
12 | 2
13 |
14 |
15 | 3
16 | 1
17 | 2
18 | 3
19 | 4
20 | 5
21 | 6
22 |
23 |
24 | 4
25 |
26 |
27 | 5
28 | g
29 | h
30 | i
31 | j
32 | k
33 | l
34 |
35 |
36 | 6
37 |
38 |
39 | 7
40 | 7
41 | 8
42 | 9
43 | 10
44 | 11
45 | 12
46 |
47 |
48 | 8
49 |
50 |
51 | 9
52 | m
53 | n
54 | o
55 | p
56 | q
57 | r
58 |
59 |
60 | 10
61 |
62 |
63 | 11
64 |
65 |
66 | 12
67 | 13
68 | 14
69 | 15
70 | 16
71 | 17
72 | 18
73 |
74 |
75 | 13
76 |
77 |
78 | 14
79 | t
80 | u
81 | v
82 | w
83 | x
84 | y
85 |
86 |
87 | 15
88 |
89 |
90 | 16
91 | 19
92 | 20
93 | 21
94 | 22
95 | 23
96 | 24
97 |
98 |
99 | 17
100 |
101 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/NotSkippingEmptyRowsDelimiter.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 |
3 | 1,2,3,4,5,6
4 |
5 | g,h,i,j,k,l
6 |
7 | 7,8,9,10,11,12
8 |
9 | m,n,o,p,q,r
10 |
11 |
12 | 13,14,15,16,17,18
13 |
14 | t,u,v,w,x,y
15 |
16 | 19,20,21,22,23,24
17 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/NotSkippingEmptyRowsDelimiter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | False
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | True
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/NotSkippingEmptyRowsDelimiterWithHeaderWithFileRowNumber.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | 2
4 |
5 |
6 | 3
7 | 1
8 | 2
9 | 3
10 | 4
11 | 5
12 | 6
13 |
14 |
15 | 4
16 |
17 |
18 | 5
19 | g
20 | h
21 | i
22 | j
23 | k
24 | l
25 |
26 |
27 | 6
28 |
29 |
30 | 7
31 | 7
32 | 8
33 | 9
34 | 10
35 | 11
36 | 12
37 |
38 |
39 | 8
40 |
41 |
42 | 9
43 | m
44 | n
45 | o
46 | p
47 | q
48 | r
49 |
50 |
51 | 10
52 |
53 |
54 | 11
55 |
56 |
57 | 12
58 | 13
59 | 14
60 | 15
61 | 16
62 | 17
63 | 18
64 |
65 |
66 | 13
67 |
68 |
69 | 14
70 | t
71 | u
72 | v
73 | w
74 | x
75 | y
76 |
77 |
78 | 15
79 |
80 |
81 | 16
82 | 19
83 | 20
84 | 21
85 | 22
86 | 23
87 | 24
88 |
89 |
90 | 17
91 |
92 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/NotSkippingEmptyRowsDelimiterWithHeaderWithFileRowNumber.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 |
3 | 1,2,3,4,5,6
4 |
5 | g,h,i,j,k,l
6 |
7 | 7,8,9,10,11,12
8 |
9 | m,n,o,p,q,r
10 |
11 |
12 | 13,14,15,16,17,18
13 |
14 | t,u,v,w,x,y
15 |
16 | 19,20,21,22,23,24
17 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/NotSkippingEmptyRowsDelimiterWithHeaderWithFileRowNumber.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | True
8 | False
9 | False
10 | False
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | True
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/NotSkippingEmptyRowsDelimiterWithHeaderWithoutFileRowNumber.out:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 1
5 | 2
6 | 3
7 | 4
8 | 5
9 | 6
10 |
11 |
12 |
13 | g
14 | h
15 | i
16 | j
17 | k
18 | l
19 |
20 |
21 |
22 | 7
23 | 8
24 | 9
25 | 10
26 | 11
27 | 12
28 |
29 |
30 |
31 | m
32 | n
33 | o
34 | p
35 | q
36 | r
37 |
38 |
39 |
40 |
41 | 13
42 | 14
43 | 15
44 | 16
45 | 17
46 | 18
47 |
48 |
49 |
50 | t
51 | u
52 | v
53 | w
54 | x
55 | y
56 |
57 |
58 |
59 | 19
60 | 20
61 | 21
62 | 22
63 | 23
64 | 24
65 |
66 |
67 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/NotSkippingEmptyRowsDelimiterWithHeaderWithoutFileRowNumber.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 |
3 | 1,2,3,4,5,6
4 |
5 | g,h,i,j,k,l
6 |
7 | 7,8,9,10,11,12
8 |
9 | m,n,o,p,q,r
10 |
11 |
12 | 13,14,15,16,17,18
13 |
14 | t,u,v,w,x,y
15 |
16 | 19,20,21,22,23,24
17 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/NotSkippingEmptyRowsDelimiterWithHeaderWithoutFileRowNumber.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | True
8 | False
9 | False
10 | False
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/NotSkippingEmptyRowsDelimiterWithoutFileRowNumber.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a
4 | b
5 | c
6 | d
7 | e
8 | f
9 |
10 |
11 |
12 | 1
13 | 2
14 | 3
15 | 4
16 | 5
17 | 6
18 |
19 |
20 |
21 | g
22 | h
23 | i
24 | j
25 | k
26 | l
27 |
28 |
29 |
30 | 7
31 | 8
32 | 9
33 | 10
34 | 11
35 | 12
36 |
37 |
38 |
39 | m
40 | n
41 | o
42 | p
43 | q
44 | r
45 |
46 |
47 |
48 |
49 | 13
50 | 14
51 | 15
52 | 16
53 | 17
54 | 18
55 |
56 |
57 |
58 | t
59 | u
60 | v
61 | w
62 | x
63 | y
64 |
65 |
66 |
67 | 19
68 | 20
69 | 21
70 | 22
71 | 23
72 | 24
73 |
74 |
75 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/NotSkippingEmptyRowsDelimiterWithoutFileRowNumber.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 |
3 | 1,2,3,4,5,6
4 |
5 | g,h,i,j,k,l
6 |
7 | 7,8,9,10,11,12
8 |
9 | m,n,o,p,q,r
10 |
11 |
12 | 13,14,15,16,17,18
13 |
14 | t,u,v,w,x,y
15 |
16 | 19,20,21,22,23,24
17 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/NotSkippingEmptyRowsDelimiterWithoutFileRowNumber.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | False
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/NotSkippingEmptyRowsFixedWidth.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1
4 | a
5 | b
6 |
7 |
8 | 2
9 |
10 |
11 | 3
12 | 1
13 | 2
14 |
15 |
16 | 4
17 |
18 |
19 | 5
20 | g
21 | h
22 |
23 |
24 | 6
25 |
26 |
27 | 7
28 | 7
29 | 8
30 |
31 |
32 | 8
33 |
34 |
35 | 9
36 | m
37 | n
38 |
39 |
40 | 10
41 |
42 |
43 | 11
44 |
45 |
46 | 12
47 | 1
48 | 1
49 |
50 |
51 | 13
52 |
53 |
54 | 14
55 | t
56 | u
57 |
58 |
59 | 15
60 |
61 |
62 | 16
63 | 1
64 | 2
65 |
66 |
67 | 17
68 |
69 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/NotSkippingEmptyRowsFixedWidth.txt:
--------------------------------------------------------------------------------
1 | a b
2 |
3 | 1 2
4 |
5 | g h
6 |
7 | 7 8
8 |
9 | m n
10 |
11 |
12 | 1 1
13 |
14 | t u
15 |
16 | 1 2
17 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/NotSkippingEmptyRowsFixedWidth.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2
5 | 2
6 |
7 | 1024
8 | 0
9 | 0
10 | 2
11 | False
12 | False
13 | False
14 | False
15 | FixedWidth
16 | False
17 | 34
18 | 0
19 | 35
20 | True
21 | 0
22 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ReadLastRowWithRowDelimiter.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a
4 | b
5 | c
6 | d
7 | e
8 | f
9 |
10 |
11 | 1
12 | 2
13 | 3
14 | 4
15 | 5
16 | 6
17 |
18 |
19 | g
20 | h
21 | i
22 | j
23 | k
24 | l
25 |
26 |
27 | 7
28 | 8
29 | 9
30 | 10
31 | 11
32 | 12
33 |
34 |
35 | m
36 | n
37 | o
38 | p
39 | q
40 | r
41 |
42 |
43 | 13
44 | 14
45 | 15
46 | 16
47 | 17
48 | 18
49 |
50 |
51 | t
52 | u
53 | v
54 | w
55 | x
56 | y
57 |
58 |
59 | 19
60 | 20
61 | 21
62 | 22
63 | 23
64 | 24
65 |
66 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ReadLastRowWithRowDelimiter.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7,8,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
9 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ReadLastRowWithRowDelimiter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ReadLastRowWithoutRowDelimiter.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a
4 | b
5 | c
6 | d
7 | e
8 | f
9 |
10 |
11 | 1
12 | 2
13 | 3
14 | 4
15 | 5
16 | 6
17 |
18 |
19 | g
20 | h
21 | i
22 | j
23 | k
24 | l
25 |
26 |
27 | 7
28 | 8
29 | 9
30 | 10
31 | 11
32 | 12
33 |
34 |
35 | m
36 | n
37 | o
38 | p
39 | q
40 | r
41 |
42 |
43 | 13
44 | 14
45 | 15
46 | 16
47 | 17
48 | 18
49 |
50 |
51 | t
52 | u
53 | v
54 | w
55 | x
56 | y
57 |
58 |
59 | 19
60 | 20
61 | 21
62 | 22
63 | 23
64 | 24
65 |
66 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ReadLastRowWithoutRowDelimiter.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7,8,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ReadLastRowWithoutRowDelimiter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ReadingInHeader.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1
4 | 2
5 | 3
6 | 4
7 | 5
8 | 6
9 |
10 |
11 | g
12 | h
13 | i
14 | j
15 | k
16 | l
17 |
18 |
19 | 7
20 | 8
21 | 9
22 | 10
23 | 11
24 | 12
25 |
26 |
27 | m
28 | n
29 | o
30 | p
31 | q
32 | r
33 |
34 |
35 | 13
36 | 14
37 | 15
38 | 16
39 | 17
40 | 18
41 |
42 |
43 | t
44 | u
45 | v
46 | w
47 | x
48 | y
49 |
50 |
51 | 19
52 | 20
53 | 21
54 | 22
55 | 23
56 | 24
57 |
58 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ReadingInHeader.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7,8,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ReadingInHeader.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | True
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ReadingInHeaderAfterComments.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1
4 | 2
5 | 3
6 | 4
7 | 5
8 | 6
9 |
10 |
11 | g
12 | h
13 | i
14 | j
15 | k
16 | l
17 |
18 |
19 | 7
20 | 8
21 | 9
22 | 10
23 | 11
24 | 12
25 |
26 |
27 | m
28 | n
29 | o
30 | p
31 | q
32 | r
33 |
34 |
35 | 13
36 | 14
37 | 15
38 | 16
39 | 17
40 | 18
41 |
42 |
43 | t
44 | u
45 | v
46 | w
47 | x
48 | y
49 |
50 |
51 | 19
52 | 20
53 | 21
54 | 22
55 | 23
56 | 24
57 |
58 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ReadingInHeaderAfterComments.txt:
--------------------------------------------------------------------------------
1 | #This shouldn't cause any problems
2 | # I can only test it to see....
3 | a,b,c,d,e,f
4 | 1,2,3,4,5,6
5 | g,h,i,j,k,l
6 | 7,8,9,10,11,12
7 | m,n,o,p,q,r
8 | 13,14,15,16,17,18
9 | t,u,v,w,x,y
10 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/ReadingInHeaderAfterComments.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | True
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/RowWithoutColumnDelimiter.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | abcdef
4 |
5 |
6 | 123456
7 |
8 |
9 | ghijkl
10 |
11 |
12 | 789101112
13 |
14 |
15 | mnopqr
16 |
17 |
18 | 131415161718
19 |
20 |
21 | tuvwxy
22 |
23 |
24 | 192021222324
25 |
26 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/RowWithoutColumnDelimiter.txt:
--------------------------------------------------------------------------------
1 | abcdef
2 | 123456
3 | ghijkl
4 | 789101112
5 | mnopqr
6 | 131415161718
7 | tuvwxy
8 | 192021222324
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/RowWithoutColumnDelimiter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SimpleDelimiter.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a
4 | b
5 | c
6 | d
7 | e
8 | f
9 |
10 |
11 | 1
12 | 2
13 | 3
14 | 4
15 | 5
16 | 6
17 |
18 |
19 | g
20 | h
21 | i
22 | j
23 | k
24 | l
25 |
26 |
27 | 7
28 | 8
29 | 9
30 | 10
31 | 11
32 | 12
33 |
34 |
35 | m
36 | n
37 | o
38 | p
39 | q
40 | r
41 |
42 |
43 | 13
44 | 14
45 | 15
46 | 16
47 | 17
48 | 18
49 |
50 |
51 | t
52 | u
53 | v
54 | w
55 | x
56 | y
57 |
58 |
59 | 19
60 | 20
61 | 21
62 | 22
63 | 23
64 | 24
65 |
66 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SimpleDelimiter.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7,8,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SimpleDelimiter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SimpleDelimiterWithControlCharacters.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1
4 | 2
5 | 3
6 | 4
7 | 5
8 | 6
9 |
10 |
11 | g
12 | h
13 | i
14 | j
15 | k
16 | l
17 |
18 |
19 | 7
20 | 8
21 | 9
22 | 10
23 | 11
24 | 12
25 |
26 |
27 | m
28 | n
29 | o
30 | p
31 | q
32 | r
33 |
34 |
35 | 13
36 | 14
37 | 15
38 | 16
39 | 17
40 | 18
41 |
42 |
43 | t
44 | u
45 | v
46 | w
47 | x
48 | y
49 |
50 |
51 | 19
52 | 20
53 | 21
54 | 22
55 | 23
56 | 24
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SimpleDelimiterWithControlCharacters.txt:
--------------------------------------------------------------------------------
1 | a,b ,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,i ,j,k,l
4 | 7,8,9,10,11,12
5 | m,n,o,p ,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
9 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SimpleDelimiterWithControlCharacters.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | True
8 | False
9 | True
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SimpleFixedWidth.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a
4 | b
5 |
6 |
7 | 1
8 | 2
9 |
10 |
11 | g
12 | h
13 |
14 |
15 | 7
16 | 8
17 |
18 |
19 | m
20 | n
21 |
22 |
23 | 1
24 | 1
25 |
26 |
27 | t
28 | u
29 |
30 |
31 | 1
32 | 2
33 |
34 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SimpleFixedWidth.txt:
--------------------------------------------------------------------------------
1 | a b
2 | 1 2
3 | g h
4 | 7 8
5 | m n
6 | 1 1
7 | t u
8 | 1 2
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SimpleFixedWidth.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2
5 | 2
6 |
7 | 1024
8 | 0
9 | 0
10 | 2
11 | False
12 | False
13 | False
14 | True
15 | FixedWidth
16 | False
17 | 34
18 | 0
19 | 35
20 | False
21 | 0
22 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingAllRows.out:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingAllRows.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7,8,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingAllRows.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 10
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingBeginningAndEndingRows.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | 7
4 | 8
5 | 9
6 | 10
7 | 11
8 | 12
9 |
10 |
11 | m
12 | n
13 | o
14 | p
15 | q
16 | r
17 |
18 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingBeginningAndEndingRows.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7,8,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingBeginningAndEndingRows.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 3
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 3
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingBeginningAndEndingRowsAll.out:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingBeginningAndEndingRowsAll.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7,8,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingBeginningAndEndingRowsAll.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 30
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 30
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingComments.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | 2
4 | a
5 | b
6 | c
7 | d
8 | e
9 | f
10 |
11 |
12 | 4
13 | 1
14 | 2
15 | 3
16 | 4
17 | 5
18 | 6
19 |
20 |
21 | 5
22 | g
23 | h
24 | i
25 | j
26 | k
27 | l
28 |
29 |
30 | 6
31 | 7
32 | 8
33 | 9
34 | 10
35 | 11
36 | 12
37 |
38 |
39 | 7
40 | m
41 | n
42 | o
43 | p
44 | q
45 | r
46 |
47 |
48 | 10
49 | 13
50 | 14
51 | 15
52 | 16
53 | 17
54 | 18
55 |
56 |
57 | 11
58 | t
59 | u
60 | v
61 | w
62 | x
63 | y
64 |
65 |
66 | 13
67 | 19
68 | 20
69 | 21
70 | 22
71 | 23
72 | 24
73 |
74 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingComments.txt:
--------------------------------------------------------------------------------
1 | # This is a simple comment which should not be read in.
2 | a,b,c,d,e,f
3 | #Yet another comment that shouldn't be read in.
4 | 1,2,3,4,5,6
5 | g,h,i,j,k,l
6 | 7,8,9,10,11,12
7 | m,n,o,p,q,r
8 | # Comment.
9 | # Comment again.
10 | 13,14,15,16,17,18
11 | t,u,v,w,x,y
12 | #Comment...
13 | 19,20,21,22,23,24
14 | #Comment yet again...
15 | #Hey, a comment after a comment.
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingComments.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | True
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingEmptyRowsWithDelimiter.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | 3
4 | a
5 | b
6 | c
7 | d
8 | e
9 | f
10 |
11 |
12 | 4
13 | 1
14 | 2
15 | 3
16 | 4
17 | 5
18 | 6
19 |
20 |
21 | 6
22 | g
23 | h
24 | i
25 | j
26 | k
27 | l
28 |
29 |
30 | 7
31 | 7
32 | 8
33 | 9
34 | 10
35 | 11
36 | 12
37 |
38 |
39 | 9
40 | m
41 | n
42 | o
43 | p
44 | q
45 | r
46 |
47 |
48 | 10
49 | 13
50 | 14
51 | 15
52 | 16
53 | 17
54 | 18
55 |
56 |
57 | 13
58 | t
59 | u
60 | v
61 | w
62 | x
63 | y
64 |
65 |
66 | 14
67 | 19
68 | 20
69 | 21
70 | 22
71 | 23
72 | 24
73 |
74 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingEmptyRowsWithDelimiter.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 | a,b,c,d,e,f
4 | 1,2,3,4,5,6
5 |
6 | g,h,i,j,k,l
7 | 7,8,9,10,11,12
8 |
9 | m,n,o,p,q,r
10 | 13,14,15,16,17,18
11 |
12 |
13 | t,u,v,w,x,y
14 | 19,20,21,22,23,24
15 |
16 |
17 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingEmptyRowsWithDelimiter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | True
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingEmptyRowsWithFixedWidth.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | 3
4 | a
5 | b
6 | c
7 | d
8 | e
9 | f
10 |
11 |
12 | 4
13 | 1
14 | 2
15 | 3
16 | 4
17 | 5
18 | 6
19 |
20 |
21 | 6
22 | g
23 | h
24 | i
25 | j
26 | k
27 | l
28 |
29 |
30 | 7
31 | 7
32 | 8
33 | 9
34 | 10
35 | 11
36 | 12
37 |
38 |
39 | 9
40 | m
41 | n
42 | o
43 | p
44 | q
45 | r
46 |
47 |
48 | 10
49 | 13
50 | 14
51 | 15
52 | 16
53 | 17
54 | 18
55 |
56 |
57 | 13
58 | t
59 | u
60 | v
61 | w
62 | x
63 | y
64 |
65 |
66 | 14
67 | 19
68 | 20
69 | 21
70 | 22
71 | 23
72 | 24
73 |
74 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingEmptyRowsWithFixedWidth.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 | a b c d e f
4 | 1 2 3 4 5 6
5 |
6 | g h i j k l
7 | 7 8 9 101112
8 |
9 | m n o p q r
10 | 131415161718
11 |
12 |
13 | t u v w x y
14 | 192021222324
15 |
16 |
17 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingEmptyRowsWithFixedWidth.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2
5 | 2
6 | 2
7 | 2
8 | 2
9 | 2
10 |
11 | 1024
12 | 0
13 | 0
14 | 6
15 | False
16 | False
17 | False
18 | True
19 | FixedWidth
20 | False
21 | 34
22 | 0
23 | 35
24 | True
25 | 0
26 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingEndingRows.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a
4 | b
5 | c
6 | d
7 | e
8 | f
9 |
10 |
11 | 1
12 | 2
13 | 3
14 | 4
15 | 5
16 | 6
17 |
18 |
19 | g
20 | h
21 | i
22 | j
23 | k
24 | l
25 |
26 |
27 | 7
28 | 8
29 | 9
30 | 10
31 | 11
32 | 12
33 |
34 |
35 | m
36 | n
37 | o
38 | p
39 | q
40 | r
41 |
42 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingEndingRows.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7,8,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingEndingRows.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 3
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingEndingRowsAll.out:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingEndingRowsAll.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7,8,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingEndingRowsAll.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 30
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingEndingRowsExactlyAll.out:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingEndingRowsExactlyAll.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7,8,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingEndingRowsExactlyAll.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 8
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingRowsAtEndOfBuffer.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | g
4 | h
5 | i
6 | j
7 | k
8 | l
9 |
10 |
11 | 6
12 | 5
13 | 4
14 | 3
15 | 2
16 | 1
17 |
18 |
19 | m
20 | n
21 | o
22 | p
23 | q
24 | r
25 |
26 |
27 | 1
28 | 3
29 | 5
30 | 7
31 | 9
32 | 2
33 |
34 |
35 | t
36 | u
37 | v
38 | w
39 | x
40 | y
41 |
42 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingRowsAtEndOfBuffer.txt:
--------------------------------------------------------------------------------
1 | a,b,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 6,5,4,3,2,1
5 | m,n,o,p,q,r
6 | 1,3,5,7,9,2
7 | t,u,v,w,x,y
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/SkippingRowsAtEndOfBuffer.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 13
4 | 0
5 | 2
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/TextQualifierBeginningAndEnd.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a
4 | b"
5 | c"c
6 | d""d
7 | e"e
8 | ""f
9 |
10 |
11 | g,h,i",j,k,l
12 |
13 |
14 | m
15 | n"op""qr
16 | s"tu""vw
17 | "x""""""
18 |
19 |
20 | y
21 | z
22 |
23 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/TextQualifierBeginningAndEnd.txt:
--------------------------------------------------------------------------------
1 | a,b",c"c,d""d,"e""e",""f
2 | "g,h,i"",j,k,l"
3 | "m",n\"op\"\"qr,"s\"tu\"\"vw",\"x""""""
4 | y,z
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/TextQualifierBeginningAndEnd.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 92
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/TextQualifierNotClosedAtEnd.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a
4 | b
5 | c
6 | , d
7 | e
8 | f
9 |
10 |
11 | 1
12 | 2
13 | 3
14 | 4
15 | 5
16 | 6
17 |
18 |
19 | g
20 | h
21 | i
22 | j
23 | k
24 | l
25 |
26 |
27 | 7
28 | ,8,
29 | 9
30 | 10
31 | 11
32 | 12
33 |
34 |
35 | m
36 | n
37 | o
38 | p
39 | q
40 | r
41 |
42 |
43 | 13
44 | 14
45 | 15
46 | 16
47 | 17
48 | 18
49 |
50 |
51 | t
52 | u
53 | v
54 | w
55 | x
56 | y
57 |
58 |
59 | 19 ,
60 | 20
61 | 21
62 | 22
63 | 23
64 | "
65 | 24
66 |
67 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/TextQualifierNotClosedAtEnd.txt:
--------------------------------------------------------------------------------
1 | "a","b ",c," , d",e,f
2 | 1,2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7," ,8, ",9,10,11,12
5 | m,n,o,p,q," r"
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | "19 , ",20,21,22,23,"
9 | 24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/TextQualifierNotClosedAtEnd.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/TextQualifierWithoutEscape.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a
4 | b
5 | c
6 | d
7 | e
8 | f
9 |
10 |
11 | 1
12 | 2
13 | 3
14 | 4
15 | 5
16 | 6
17 |
18 |
19 | g
20 | h
21 | i
22 | j
23 | k
24 | l
25 |
26 |
27 | 7
28 | 8
29 | 9
30 | 10
31 | 11
32 | 12
33 |
34 |
35 | m
36 | n
37 | o
38 | p
39 | q
40 | r
41 |
42 |
43 | 13
44 | 14
45 | 15
46 | 16
47 | 17
48 | 18
49 |
50 |
51 | t
52 | u
53 | v
54 | w
55 | x
56 | y
57 |
58 |
59 | 19
60 | 20
61 | 21
62 | 22
63 | 23
64 | 24
65 |
66 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/TextQualifierWithoutEscape.txt:
--------------------------------------------------------------------------------
1 | "a",b,c,d,e,f
2 | 1,2,3,4,5,6
3 | g,h,"i",j,k,l
4 | 7,8,9,10,11,12
5 | m,n,o,p,q,r
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/TextQualifierWithoutEscape.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/TextQualifiersWithDelimiters.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a
4 | b
5 | c
6 | , d
7 | e
8 | f
9 |
10 |
11 | "
12 | 2
13 | 3
14 | 4
15 | 5
16 | 6
17 |
18 |
19 | g
20 | h
21 | i
22 | j
23 | k
24 | l
25 |
26 |
27 | 7
28 | ,8,
29 | 9
30 | 10
31 | 11
32 | 12
33 |
34 |
35 | m
36 | n
37 | o
38 | p
39 | q
40 | r
41 |
42 |
43 | 13
44 | 14
45 | 15
46 | 16
47 | 17
48 | 18
49 |
50 |
51 | t
52 | u
53 | v
54 | w
55 | x
56 | y
57 |
58 |
59 | 19 ,
60 | 20
61 | 21
62 | 22
63 | 23
64 |
65 | 24
66 |
67 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/TextQualifiersWithDelimiters.txt:
--------------------------------------------------------------------------------
1 | "a","b ",c," , d",e,f
2 | """",2,3,4,5,6
3 | g,h,i,j,k,l
4 | 7," ,8, ",9,10,11,12
5 | m,n,o,p,q," r"
6 | 13,14,15,16,17,18
7 | t,u,v,w,x,y
8 | "19 , ",20,21,22,23,"
9 | 24"
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/TextQualifiersWithDelimiters.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/TrimmingResults.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | a
4 | b
5 | c
6 | d
7 | e
8 | f
9 |
10 |
11 | 1
12 | 2
13 | 3
14 | 4
15 | 5
16 | 6
17 |
18 |
19 | g
20 | h
21 | i
22 | j
23 | k
24 | l
25 |
26 |
27 | 7
28 | 8
29 | 9
30 | 10
31 | 11
32 | 12
33 |
34 |
35 | m
36 | n
37 | o
38 | p
39 | q
40 | r
41 |
42 |
43 | 13
44 | 14
45 | 15
46 | 16
47 | 17
48 | 18
49 |
50 |
51 | t
52 | u
53 | v
54 | w
55 | x
56 | y
57 |
58 |
59 | 19
60 | 20
61 | 21
62 | 22
63 | 23
64 | 24
65 |
66 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/TrimmingResults.txt:
--------------------------------------------------------------------------------
1 | a ,b,c,d,e,f
2 | 1, 2,3 ,4,5,6
3 | g,h,i,j,k,l
4 | 7,8,9,10,11,12
5 | m,n,o,"p ",q,r
6 | 13,14,15,16, 17,18
7 | t,u,v,w ,x,y
8 | 19,20,21,22,23,24
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/TrimmingResults.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | True
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/UnicodeSupported.out:
--------------------------------------------------------------------------------
1 |
2 |
3 | между
4 | tölvuiðnaðarins
5 | ũΩ₤
6 | používat
7 |
8 |
9 | různá
10 | čísla
11 | pro
12 | członkowskich
13 |
14 |
15 | rozumieją
16 | přiřazuje
17 | gemeinnützige
18 | är också
19 |
20 |
21 | sprachunabhängig
22 | that's all
23 | for
24 | now
25 |
26 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/UnicodeSupported.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndrewRissing/GenericParsing/6ef9b494c2f1cef387721cf41d4e6e952ea9fa9f/GenericParsing.UnitTests/TestData/UnicodeSupported.txt
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/UnicodeSupported.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1024
4 | 0
5 | 0
6 | 0
7 | False
8 | False
9 | False
10 | True
11 | Delimited
12 | False
13 | 44
14 | 34
15 | 0
16 | 35
17 | False
18 | 0
19 |
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/XmlTest.out:
--------------------------------------------------------------------------------
1 | a b 1 2 g h 7 8 m n 1 1 t u 1 2
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/XmlTest.txt:
--------------------------------------------------------------------------------
1 | a b
2 | 1 2
3 | g h
4 | 7 8
5 | m n
6 | 1 1
7 | t u
8 | 1 2
--------------------------------------------------------------------------------
/GenericParsing.UnitTests/TestData/XmlTest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 2
5 | 2
6 |
7 | 1024
8 | 0
9 | 0
10 | 2
11 | False
12 | False
13 | False
14 | True
15 | FixedWidth
16 | False
17 | 34
18 | 0
19 | 35
20 | False
21 | 0
22 |
--------------------------------------------------------------------------------
/GenericParsing.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 12.00
2 | # Visual Studio Version 17
3 | VisualStudioVersion = 17.5.33627.172
4 | MinimumVisualStudioVersion = 10.0.40219.1
5 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{936F8079-8AE8-4F7A-921C-9E44920F4B9E}"
6 | ProjectSection(SolutionItems) = preProject
7 | .gitignore = .gitignore
8 | LICENSE.md = LICENSE.md
9 | README.md = README.md
10 | EndProjectSection
11 | EndProject
12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GenericParsing.PerformanceTests", "GenericParsing.PerformanceTests\GenericParsing.PerformanceTests.csproj", "{28A4801F-B624-4AED-9765-B172203EB188}"
13 | EndProject
14 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GenericParsing", "GenericParsing\GenericParsing.csproj", "{3E34D5EB-B746-4672-AA9D-F73807A59390}"
15 | EndProject
16 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GenericParsing.UnitTests", "GenericParsing.UnitTests\GenericParsing.UnitTests.csproj", "{C2022AFC-520F-424E-A367-9F16BDAC45C8}"
17 | EndProject
18 | Global
19 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
20 | Debug|Any CPU = Debug|Any CPU
21 | Release|Any CPU = Release|Any CPU
22 | EndGlobalSection
23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
24 | {28A4801F-B624-4AED-9765-B172203EB188}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25 | {28A4801F-B624-4AED-9765-B172203EB188}.Debug|Any CPU.Build.0 = Debug|Any CPU
26 | {28A4801F-B624-4AED-9765-B172203EB188}.Release|Any CPU.ActiveCfg = Release|Any CPU
27 | {28A4801F-B624-4AED-9765-B172203EB188}.Release|Any CPU.Build.0 = Release|Any CPU
28 | {3E34D5EB-B746-4672-AA9D-F73807A59390}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29 | {3E34D5EB-B746-4672-AA9D-F73807A59390}.Debug|Any CPU.Build.0 = Debug|Any CPU
30 | {3E34D5EB-B746-4672-AA9D-F73807A59390}.Release|Any CPU.ActiveCfg = Release|Any CPU
31 | {3E34D5EB-B746-4672-AA9D-F73807A59390}.Release|Any CPU.Build.0 = Release|Any CPU
32 | {C2022AFC-520F-424E-A367-9F16BDAC45C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33 | {C2022AFC-520F-424E-A367-9F16BDAC45C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
34 | {C2022AFC-520F-424E-A367-9F16BDAC45C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
35 | {C2022AFC-520F-424E-A367-9F16BDAC45C8}.Release|Any CPU.Build.0 = Release|Any CPU
36 | EndGlobalSection
37 | GlobalSection(SolutionProperties) = preSolution
38 | HideSolutionNode = FALSE
39 | EndGlobalSection
40 | GlobalSection(ExtensibilityGlobals) = postSolution
41 | SolutionGuid = {7A378532-1A76-43DF-96B3-C94FB6474C1B}
42 | EndGlobalSection
43 | GlobalSection(TestCaseManagementSettings) = postSolution
44 | CategoryFile = GenericParsing.vsmdi
45 | EndGlobalSection
46 | EndGlobal
47 |
--------------------------------------------------------------------------------
/GenericParsing.vsmdi:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/GenericParsing/FieldType.cs:
--------------------------------------------------------------------------------
1 | // GenericParsing
2 | // Copyright © 2018 Andrew Rissing
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
8 | // of the Software, and to permit persons to whom the Software is furnished to do so,
9 | // subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in all
12 | // copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 | // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17 | // FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 |
20 | namespace GenericParsing
21 | {
22 | ///
23 | /// Indicates whether text fields are delimited or fixed width.
24 | ///
25 | public enum FieldType
26 | {
27 | ///
28 | /// Indicates that the fields are delimited.
29 | ///
30 | Delimited = 0,
31 | ///
32 | /// Indicates that the fields are fixed width.
33 | ///
34 | FixedWidth = 1,
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/GenericParsing/GenericParserAdapter.cs:
--------------------------------------------------------------------------------
1 | // GenericParsing
2 | // Copyright © 2018 Andrew Rissing
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
8 | // of the Software, and to permit persons to whom the Software is furnished to do so,
9 | // subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in all
12 | // copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 | // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17 | // FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 |
20 | using System;
21 | using System.Data;
22 | using System.IO;
23 | using System.Text;
24 | using System.Xml;
25 |
26 | namespace GenericParsing
27 | {
28 | ///
29 | /// The is used to modify the
30 | /// to allow it parse a file and place them into various formats.
31 | ///
32 | ///
33 | public class GenericParserAdapter : GenericParser
34 | {
35 | #region Constants
36 |
37 | ///
38 | /// Defines the default value for including the file line number (false).
39 | ///
40 | public const bool DefaultIncludeFileLineNumber = false;
41 | ///
42 | /// Defines the number of skip ending data rows (0).
43 | ///
44 | public const int DefaultSkipEndingDataRows = 0;
45 |
46 | private const string XML_INCLUDE_FILE_LINE_NUMBER = "IncludeFileLineNumber";
47 | private const string XML_SKIP_ENDING_DATA_ROWS = "SkipEndingDataRows";
48 | private const string FILE_LINE_NUMBER = "FileLineNumber";
49 |
50 | #endregion Constants
51 |
52 | #region Static Code
53 |
54 | ///
55 | /// Adds a column name to the given , such that
56 | /// it ensures a unique column name.
57 | ///
58 | /// The to add the column to.
59 | /// The desired column name to add.
60 | private static void AddColumnToTable(DataTable dtData, string strColumnName)
61 | {
62 | if (strColumnName != null)
63 | {
64 | if (dtData.Columns[strColumnName] == null)
65 | dtData.Columns.Add(strColumnName);
66 | else
67 | {
68 | string strNewColumnName;
69 | int intCount = 0;
70 |
71 | // Looks like we need to generate a new column name.
72 | do
73 | {
74 | strNewColumnName = string.Format("{0}{1}", strColumnName, ++intCount);
75 | }
76 | while (dtData.Columns[strNewColumnName] != null);
77 |
78 | dtData.Columns.Add(strNewColumnName);
79 | }
80 | }
81 | else
82 | dtData.Columns.Add();
83 | }
84 |
85 | #endregion Static Code
86 |
87 | #region Constructors
88 |
89 | ///
90 | /// Constructs an instance of a
91 | /// with the default settings.
92 | ///
93 | ///
94 | /// When using this constructor, the datasource must be set prior to using the parser
95 | /// (using ), otherwise an exception will be thrown.
96 | ///
97 | public GenericParserAdapter()
98 | : base()
99 | {
100 | this.IncludeFileLineNumber = GenericParserAdapter.DefaultIncludeFileLineNumber;
101 | this.SkipEndingDataRows = GenericParserAdapter.DefaultSkipEndingDataRows;
102 | }
103 | ///
104 | /// Constructs an instance of a and sets
105 | /// the initial datasource as the file referenced by the string passed in.
106 | ///
107 | /// The file name to set as the initial datasource.
108 | public GenericParserAdapter(string strFileName)
109 | : this()
110 | {
111 | this.SetDataSource(strFileName);
112 | }
113 | ///
114 | /// Constructs an instance of a and sets
115 | /// the initial datasource as the file referenced by the string passed in with
116 | /// the provided encoding.
117 | ///
118 | /// The file name to set as the initial datasource.
119 | /// The of the file being referenced.
120 | public GenericParserAdapter(string strFileName, Encoding encoding)
121 | : this()
122 | {
123 | this.SetDataSource(strFileName, encoding);
124 | }
125 | ///
126 | /// Constructs an instance of a and sets
127 | /// the initial datasource as the passed in.
128 | ///
129 | ///
130 | /// The containing the data to be parsed.
131 | ///
132 | public GenericParserAdapter(TextReader txtReader)
133 | : this()
134 | {
135 | this.SetDataSource(txtReader);
136 | }
137 |
138 | #endregion Constructors
139 |
140 | #region Public Code
141 |
142 | ///
143 | /// Gets or sets whether or not the from where
144 | /// the data was retrieved should be included as part of the result set.
145 | ///
146 | ///
147 | ///
148 | /// Default:
149 | ///
150 | ///
151 | /// If parsing has started, this value cannot be updated.
152 | ///
153 | ///
154 | /// Attempting to modify the configuration, while parsing.
155 | public bool IncludeFileLineNumber
156 | {
157 | get
158 | {
159 | return this.m_blnIncludeFileLineNumber;
160 | }
161 | set
162 | {
163 | if (this.m_ParserState == ParserState.Parsing)
164 | throw new InvalidOperationException("Parsing has already begun, close the existing parse first.");
165 |
166 | this.m_blnIncludeFileLineNumber = value;
167 | }
168 | }
169 | ///
170 | /// Gets or sets the number of rows of data to ignore at the end of the file.
171 | ///
172 | /// The number of data rows to skip at the end of the datasource
173 | ///
174 | ///
175 | /// A value of zero will ensure no rows are ignored.
176 | ///
177 | ///
178 | /// Default: 0
179 | ///
180 | ///
181 | /// If parsing has started, this value cannot be updated.
182 | ///
183 | ///
184 | /// Attempting to modify the configuration, while parsing.
185 | public int SkipEndingDataRows
186 | {
187 | get
188 | {
189 | return this.m_intSkipEndingDataRows;
190 | }
191 | set
192 | {
193 | if (this.m_ParserState == ParserState.Parsing)
194 | throw new InvalidOperationException("Parsing has already begun, close the existing parse first.");
195 |
196 | this.m_intSkipEndingDataRows = value;
197 |
198 | if (this.m_intSkipEndingDataRows < 0)
199 | this.m_intSkipEndingDataRows = 0;
200 | }
201 | }
202 |
203 | ///
204 | /// Generates an based on the data stored within
205 | /// the entire data source after it was parsed.
206 | ///
207 | ///
208 | /// The containing all of the data in the data
209 | /// source.
210 | ///
211 | ///
212 | /// Attempting to read without properly setting up the .
213 | ///
214 | ///
215 | /// Thrown in the situations where the cannot continue
216 | /// due to a conflict between the setup and the data being parsed.
217 | ///
218 | ///
219 | ///
220 | /// using (GenericParserAdapter p = new GenericParserAdapter(@"C:\MyData.txt"))
221 | /// XmlDocument xmlDoc = p.GetXml();
222 | ///
223 | ///
224 | public XmlDocument GetXml()
225 | {
226 | DataSet dsData;
227 | XmlDocument xmlDocument = null;
228 |
229 | dsData = this.GetDataSet();
230 |
231 | if (dsData != null)
232 | {
233 | xmlDocument = new XmlDocument();
234 | xmlDocument.LoadXml(dsData.GetXml());
235 | }
236 |
237 | return xmlDocument;
238 | }
239 | ///
240 | /// Generates a based on the data stored within
241 | /// the entire data source after it was parsed.
242 | ///
243 | ///
244 | /// The containing all of the data in the
245 | /// data source.
246 | ///
247 | ///
248 | /// Attempting to read without properly setting up the .
249 | ///
250 | ///
251 | /// Thrown in the situations where the cannot continue
252 | /// due to a conflict between the setup and the data being parsed.
253 | ///
254 | ///
255 | ///
256 | /// using (GenericParserAdapter p = new GenericParserAdapter(@"C:\MyData.txt"))
257 | /// DataSet dsResults = p.GetDataSet();
258 | ///
259 | ///
260 | public DataSet GetDataSet()
261 | {
262 | DataTable dtData;
263 | DataSet dsData = null;
264 |
265 | dtData = this.GetDataTable();
266 |
267 | if (dtData != null)
268 | {
269 | dsData = new DataSet();
270 | dsData.Tables.Add(dtData);
271 | }
272 |
273 | return dsData;
274 | }
275 | ///
276 | /// Generates a based on the data stored within
277 | /// the entire data source after it was parsed.
278 | ///
279 | ///
280 | /// The containing all of the data in the data
281 | /// source.
282 | ///
283 | ///
284 | /// Attempting to read without properly setting up the .
285 | ///
286 | ///
287 | /// Thrown in the situations where the cannot continue
288 | /// due to a conflict between the setup and the data being parsed.
289 | ///
290 | ///
291 | ///
292 | /// using (GenericParserAdapter p = new GenericParserAdapter(@"C:\MyData.txt"))
293 | /// DataTable dtResults = p.GetDataTable();
294 | ///
295 | ///
296 | public DataTable GetDataTable()
297 | {
298 | DataRow drRow;
299 | DataTable dtData;
300 | int intSkipRowsAtEnd;
301 |
302 | dtData = new DataTable();
303 | dtData.BeginLoadData();
304 |
305 | this.m_intCreatedColumns = 0;
306 |
307 | while (this.Read())
308 | {
309 | // See if we have the appropriate number of columns.
310 | if (this.m_lstColumnNames.Count > this.m_intCreatedColumns)
311 | this.CreateDataTableColumns(dtData);
312 |
313 | if (!this.IsCurrentRowEmpty || !this.SkipEmptyRows)
314 | {
315 | drRow = dtData.NewRow();
316 |
317 | if (this.m_blnIncludeFileLineNumber)
318 | {
319 | drRow[0] = this.FileRowNumber;
320 |
321 | // Now, add in the data retrieved from the current row.
322 | for (int intColumnIndex = 0; intColumnIndex < this.m_lstData.Count; ++intColumnIndex)
323 | drRow[intColumnIndex + 1] = this.m_lstData[intColumnIndex];
324 | }
325 | else
326 | {
327 | // Since we don't have to account for the row number, just place the value right into the data row.
328 | drRow.ItemArray = this.m_lstData.ToArray();
329 | }
330 |
331 | dtData.Rows.Add(drRow);
332 | }
333 | }
334 |
335 | if (this.m_lstColumnNames.Count > this.m_intCreatedColumns)
336 | this.CreateDataTableColumns(dtData);
337 |
338 | intSkipRowsAtEnd = this.m_intSkipEndingDataRows;
339 |
340 | // Remove any rows at the end that need to be skipped.
341 | while ((intSkipRowsAtEnd-- > 0) && (dtData.Rows.Count > 0))
342 | dtData.Rows.RemoveAt(dtData.Rows.Count - 1);
343 |
344 | dtData.EndLoadData();
345 |
346 | return dtData;
347 | }
348 |
349 | private void CreateDataTableColumns(DataTable dtData)
350 | {
351 | // Add in our column to store off the file line number.
352 | if (this.m_blnIncludeFileLineNumber && (this.m_intCreatedColumns < 1))
353 | dtData.Columns.Add(GenericParserAdapter.FILE_LINE_NUMBER);
354 |
355 | for (int intColumnIndex = this.m_intCreatedColumns; intColumnIndex < this.m_lstColumnNames.Count; ++intColumnIndex, ++this.m_intCreatedColumns)
356 | GenericParserAdapter.AddColumnToTable(dtData, this.m_lstColumnNames[intColumnIndex]);
357 | }
358 |
359 | ///
360 | /// Loads the base class from the
361 | /// and then retrieves additional information
362 | /// from the Xml that is specific to the .
363 | ///
364 | ///
365 | /// The containing the configuration information.
366 | ///
367 | /// In the event that the XmlConfig file contains a value that is invalid,
368 | /// an could be thrown.
369 | /// In the event that the XmlConfig file contains a value that is invalid,
370 | /// an could be thrown.
371 | /// In the event that the XmlConfig file contains a value that is invalid,
372 | /// an could be thrown.
373 | /// Attempting to modify the configuration, while parsing.
374 | public override void Load(XmlDocument xmlConfig)
375 | {
376 | XmlElement xmlElement;
377 |
378 | // Load the base information for the GenericParser.
379 | base.Load(xmlConfig);
380 |
381 | // Initialize the value for the file line number.
382 | this.m_blnIncludeFileLineNumber = GenericParserAdapter.DefaultIncludeFileLineNumber;
383 | this.m_intSkipEndingDataRows = GenericParserAdapter.DefaultSkipEndingDataRows;
384 |
385 | /////////////////////////////////////////////
386 | // Load the rest of the information that's //
387 | // specific to the GenericParserAdapter. //
388 | /////////////////////////////////////////////
389 |
390 | xmlElement = xmlConfig.DocumentElement[XML_INCLUDE_FILE_LINE_NUMBER];
391 |
392 | if ((xmlElement != null) && (xmlElement.InnerText != null))
393 | this.IncludeFileLineNumber = Convert.ToBoolean(xmlElement.InnerText);
394 |
395 | /////////////////////////////////////////////////////////////
396 |
397 | xmlElement = xmlConfig.DocumentElement[XML_SKIP_ENDING_DATA_ROWS];
398 |
399 | if ((xmlElement != null) && (xmlElement.InnerText != null))
400 | this.SkipEndingDataRows = Convert.ToInt32(xmlElement.InnerText);
401 | }
402 | ///
403 | /// Saves the configuration of the
404 | /// to an .
405 | ///
406 | ///
407 | /// The that will store the configuration
408 | /// information of the current setup of the .
409 | ///
410 | public override XmlDocument Save()
411 | {
412 | XmlDocument xmlConfig = base.Save();
413 | XmlElement xmlElement;
414 |
415 | ///////////////////////////////////////////////////////////////
416 | // Take the document and insert the additional configuration //
417 | // specific to the GenericParserAdapter. //
418 | ///////////////////////////////////////////////////////////////
419 |
420 | xmlElement = xmlConfig.CreateElement(XML_INCLUDE_FILE_LINE_NUMBER);
421 | xmlElement.InnerText = this.IncludeFileLineNumber.ToString();
422 | xmlConfig.DocumentElement.AppendChild(xmlElement);
423 |
424 | /////////////////////////////////////////////////////////////
425 |
426 | xmlElement = xmlConfig.CreateElement(XML_SKIP_ENDING_DATA_ROWS);
427 | xmlElement.InnerText = this.m_intSkipEndingDataRows.ToString();
428 | xmlConfig.DocumentElement.AppendChild(xmlElement);
429 |
430 | return xmlConfig;
431 | }
432 |
433 | #endregion Public Code
434 |
435 | #region Private Code
436 |
437 | private bool m_blnIncludeFileLineNumber;
438 | private int m_intSkipEndingDataRows;
439 | private int m_intCreatedColumns;
440 |
441 | #endregion Private Code
442 | }
443 | }
--------------------------------------------------------------------------------
/GenericParsing/GenericParsing.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.0;net8.0
4 | true
5 | 1.6.0
6 | Andrew Rissing
7 | N/A
8 | AndrewRissing
9 | GenericParsing
10 | The GenericParser is a robust C# implementation of a parser for delimited and fixed width format files.
11 | The GenericParser is a robust C# implementation of a parser for delimited and fixed width format files. It provides a variety of features (ex. custom delimiters, text qualifiers, loading/saving configuration from XML, and many more), performant, and thoroughly tested.
12 | Copyright © 2018 Andrew Rissing
13 | MIT
14 | https://github.com/AndrewRissing/GenericParsing
15 |
16 | GenericParsing Parsing CSV TSV Delimited
17 | https://github.com/AndrewRissing/GenericParsing
18 | GitHub
19 |
20 | - Added GetColumnNames() [By M-Patrone].
21 | - Removed .NET 6 support.
22 |
23 | - Added .NET 6, .NET 8 compilations.
24 | - Reintroduced signing the assembly.
25 | - Added ColumnNameComparisonMode (jonataspc).
26 | - Request only read access when opening a file.
27 | - Updated the license to MIT.
28 | - Added new target frameworks (.NET 4.5.2, .NET 4.6.1).
29 | - Added Readme.md
30 | - Moved nuget package to GenericParsing (the GenericParser package is now deprecated).
31 | - Migrated to .NET Standard 2.0.
32 | - Signed the GenericParsing assembly.
33 | true
34 |
35 |
36 | True
37 | GenericParsing.snk
38 |
39 |
40 |
41 |
42 |
43 |
44 | Code
45 |
46 |
47 |
--------------------------------------------------------------------------------
/GenericParsing/GenericParsing.shfbproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 | Debug
7 | AnyCPU
8 | 2.0
9 | {b54bb34b-54d3-4bb8-bb49-6f8aaa52cde7}
10 | 1.8.0.3
11 |
13 | Documentation
14 | Documentation
15 | Documentation
16 |
17 | .\Help\
18 | GenericParsing
19 | 2.0.50727
20 | HtmlHelp1
21 | False
22 | The GenericParsing namespace is designed to provide a flexible and efficient mannerof parsing various flat files formats.
23 | Copyright ©%3b 2010 Andrew Rissing
24 | http://www.codeproject.com/info/cpol10.aspx
25 | GenericParsing
26 | vs2005
27 | Local
28 | Standard
29 | 1.1.0.0
30 | Parameter, Returns, AutoDocumentCtors, Namespace, TypeParameter, AutoDocumentDispose
31 |
32 |
33 |
34 |
35 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/GenericParsing/Help/GenericParsing.chm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndrewRissing/GenericParsing/6ef9b494c2f1cef387721cf41d4e6e952ea9fa9f/GenericParsing/Help/GenericParsing.chm
--------------------------------------------------------------------------------
/GenericParsing/Help/GenericParsing.mshc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndrewRissing/GenericParsing/6ef9b494c2f1cef387721cf41d4e6e952ea9fa9f/GenericParsing/Help/GenericParsing.mshc
--------------------------------------------------------------------------------
/GenericParsing/ParserState.cs:
--------------------------------------------------------------------------------
1 | // GenericParsing
2 | // Copyright © 2018 Andrew Rissing
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
8 | // of the Software, and to permit persons to whom the Software is furnished to do so,
9 | // subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in all
12 | // copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 | // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17 | // FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 |
20 | namespace GenericParsing
21 | {
22 | ///
23 | /// The current internal state of the parser.
24 | ///
25 | public enum ParserState
26 | {
27 | ///
28 | /// Indicates that the parser has no datasource and is not properly setup.
29 | ///
30 | NoDataSource = 0,
31 | ///
32 | /// Indicates that the parser is ready to begin parsing.
33 | ///
34 | Ready = 1,
35 | ///
36 | /// Indicates that the parser is currently parsing the datasource.
37 | ///
38 | Parsing = 2,
39 | ///
40 | /// Indicates that the parser has finished parsing the datasource.
41 | ///
42 | Finished = 3
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/GenericParsing/ParsingException.cs:
--------------------------------------------------------------------------------
1 | // GenericParsing
2 | // Copyright © 2018 Andrew Rissing
3 | //
4 | // Permission is hereby granted, free of charge, to any person obtaining a copy
5 | // of this software and associated documentation files (the "Software"), to deal
6 | // in the Software without restriction, including without limitation the rights
7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
8 | // of the Software, and to permit persons to whom the Software is furnished to do so,
9 | // subject to the following conditions:
10 | //
11 | // The above copyright notice and this permission notice shall be included in all
12 | // copies or substantial portions of the Software.
13 | //
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 | // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16 | // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17 | // FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
18 | // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 |
20 | using System;
21 |
22 | #if !(NET6_0_OR_GREATER)
23 | using System.Runtime.Serialization;
24 | using System.Security.Permissions;
25 | #endif
26 |
27 | namespace GenericParsing
28 | {
29 | ///
30 | /// is an exception class meant for states where
31 | /// the parser can no longer continue parsing due to the data found in the
32 | /// data-source.
33 | ///
34 | [Serializable]
35 | public class ParsingException : Exception
36 | {
37 | #if !(NET6_0_OR_GREATER)
38 | #region Constants
39 |
40 | private const string SERIALIZATION_COLUMN_NUMBER = "ColumnNumber";
41 | private const string SERIALIZATION_FILE_ROW_NUMBER = "FileRowNumber";
42 |
43 | #endregion Constants
44 | #endif
45 |
46 | #region Constructors
47 |
48 | ///
49 | /// Creates a new with default values.
50 | ///
51 | public ParsingException() : base()
52 | {
53 | /* Intentionally left blank */
54 | }
55 |
56 | ///
57 | /// Creates a new containing a message and the
58 | /// file line number that the error occured.
59 | ///
60 | ///
61 | /// The message indicating the root cause of the error.
62 | ///
63 | /// The file line number the error occured on.
64 | /// The column number the error occured on.
65 | public ParsingException(string strMessage, int intFileRowNumber, int intColumnNumber)
66 | : base(strMessage)
67 | {
68 | this.m_intFileRowNumber = intFileRowNumber;
69 | this.m_intColumnNumber = intColumnNumber;
70 | }
71 |
72 | #if !(NET6_0_OR_GREATER)
73 | ///
74 | /// Creates a new with seralized data.
75 | ///
76 | ///
77 | /// The that contains information
78 | /// about the exception.
79 | ///
80 | ///
81 | /// The that contains information
82 | /// about the source/destination of the exception.
83 | ///
84 | protected ParsingException(SerializationInfo sInfo, StreamingContext sContext)
85 | : base(sInfo, sContext)
86 | {
87 | this.m_intFileRowNumber = sInfo.GetInt32(SERIALIZATION_FILE_ROW_NUMBER);
88 | this.m_intColumnNumber = sInfo.GetInt32(SERIALIZATION_COLUMN_NUMBER);
89 | }
90 | #endif
91 |
92 | #endregion Constructors
93 |
94 | #region Public Properties
95 |
96 | ///
97 | /// The line number in the file that the exception was thrown at.
98 | ///
99 | public int FileRowNumber
100 | {
101 | get
102 | {
103 | return this.m_intFileRowNumber;
104 | }
105 | }
106 |
107 | ///
108 | /// The column number in the file that the exception was thrown at.
109 | ///
110 | public int ColumnNumber
111 | {
112 | get
113 | {
114 | return this.m_intColumnNumber;
115 | }
116 | }
117 |
118 | #endregion Public Properties
119 |
120 | #region Private Members
121 |
122 | private readonly int m_intFileRowNumber;
123 | private readonly int m_intColumnNumber;
124 |
125 | #endregion Private Members
126 |
127 | #if !(NET6_0_OR_GREATER)
128 | #region Overridden Methods
129 |
130 | ///
131 | /// When overridden in a derived class, sets the
132 | /// with information about the exception.
133 | ///
134 | ///
135 | /// The that holds the serialized object data
136 | /// about the exception being thrown.
137 | ///
138 | ///
139 | /// The that contains contextual information about the source
140 | /// or destination.
141 | ///
142 | [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
143 | public override void GetObjectData(SerializationInfo info, StreamingContext context)
144 | {
145 | base.GetObjectData(info, context);
146 |
147 | info.AddValue(SERIALIZATION_FILE_ROW_NUMBER, this.m_intFileRowNumber);
148 | info.AddValue(SERIALIZATION_COLUMN_NUMBER, this.m_intColumnNumber);
149 | }
150 |
151 | #endregion Overridden Methods
152 | #endif
153 | }
154 | }
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Andrew Rissing
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Performance Results/1000000_Rows.txt:
--------------------------------------------------------------------------------
1 | Number of iterations of data [1 iteration = 10 rows]: 100000
2 |
3 | The following will generate performance information about the
4 | GenericParser class.
5 |
6 | Executions for each test: 10
7 | Rows of CSV Data: 1000000
8 | Rows of FixedWidth Data: 1000000
9 |
10 | <- Press Enter to Proceed ->
11 |
12 | Size of Csv data file: 138.28 mb
13 |
14 | Delimited MS Text Driver - Avg. Time 45342.7 (ms) [ 3.050 mb/s]
15 | Delimited MS Text Field Parser - Avg. Time 53648.5 (ms) [ 2.578 mb/s]
16 | Delimited CsvReader 3.7 - Avg. Time 2648.6 (ms) [ 52.210 mb/s]
17 | Delimited GenericParser 1.0 - Avg. Time 5064.3 (ms) [ 27.305 mb/s]
18 | Delimited GenericParser 1.1 - Avg. Time 3497.4 (ms) [ 39.539 mb/s]
19 |
20 | ============================================
21 |
22 | Size of FixedWidth data file: 167.85 mb
23 |
24 | FixedWidth MS Text Driver - Avg. Time 44021.6 (ms) [ 3.813 mb/s]
25 | FixedWidth MS Text Field Parser - Avg. Time 45490.0 (ms) [ 3.690 mb/s]
26 | FixedWidth GenericParser 1.0 - Avg. Time 8296.7 (ms) [ 20.231 mb/s]
27 | FixedWidth GenericParser 1.1 - Avg. Time 4474.1 (ms) [ 37.515 mb/s]
28 |
29 | Completed Performance testing.
30 |
31 | <- Press Enter to Exit ->
32 |
--------------------------------------------------------------------------------
/Performance Results/100000_Rows.txt:
--------------------------------------------------------------------------------
1 | Number of iterations of data [1 iteration = 10 rows]: 10000
2 |
3 | The following will generate performance information about the
4 | GenericParser class.
5 |
6 | Executions for each test: 10
7 | Rows of CSV Data: 100000
8 | Rows of FixedWidth Data: 100000
9 |
10 | <- Press Enter to Proceed ->
11 |
12 | Size of Csv data file: 13.83 mb
13 |
14 | Delimited MS Text Driver - Avg. Time 4606.7 (ms) [ 3.002 mb/s]
15 | Delimited MS Text Field Parser - Avg. Time 5347.7 (ms) [ 2.586 mb/s]
16 | Delimited CsvReader 3.7 - Avg. Time 263.2 (ms) [ 52.539 mb/s]
17 | Delimited GenericParser 1.0 - Avg. Time 494.5 (ms) [ 27.964 mb/s]
18 | Delimited GenericParser 1.1 - Avg. Time 339.3 (ms) [ 40.755 mb/s]
19 |
20 | ============================================
21 |
22 | Size of FixedWidth data file: 16.78 mb
23 |
24 | FixedWidth MS Text Driver - Avg. Time 4481.8 (ms) [ 3.745 mb/s]
25 | FixedWidth MS Text Field Parser - Avg. Time 4610.4 (ms) [ 3.641 mb/s]
26 | FixedWidth GenericParser 1.0 - Avg. Time 826.2 (ms) [ 20.316 mb/s]
27 | FixedWidth GenericParser 1.1 - Avg. Time 440.7 (ms) [ 38.086 mb/s]
28 |
29 | Completed Performance testing.
30 |
31 | <- Press Enter to Exit ->
32 |
--------------------------------------------------------------------------------
/Performance Results/10000_Rows.txt:
--------------------------------------------------------------------------------
1 | Number of iterations of data [1 iteration = 10 rows]: 1000
2 |
3 | The following will generate performance information about the
4 | GenericParser class.
5 |
6 | Executions for each test: 10
7 | Rows of CSV Data: 10000
8 | Rows of FixedWidth Data: 10000
9 |
10 | <- Press Enter to Proceed ->
11 |
12 | Size of Csv data file: 1.38 mb
13 |
14 | Delimited MS Text Driver - Avg. Time 526.2 (ms) [ 2.628 mb/s]
15 | Delimited MS Text Field Parser - Avg. Time 536.3 (ms) [ 2.578 mb/s]
16 | Delimited CsvReader 3.7 - Avg. Time 27.7 (ms) [ 49.922 mb/s]
17 | Delimited GenericParser 1.0 - Avg. Time 50.8 (ms) [ 27.221 mb/s]
18 | Delimited GenericParser 1.1 - Avg. Time 35.6 (ms) [ 38.843 mb/s]
19 |
20 | ============================================
21 |
22 | Size of FixedWidth data file: 1.68 mb
23 |
24 | FixedWidth MS Text Driver - Avg. Time 508.3 (ms) [ 3.302 mb/s]
25 | FixedWidth MS Text Field Parser - Avg. Time 448.2 (ms) [ 3.745 mb/s]
26 | FixedWidth GenericParser 1.0 - Avg. Time 82.8 (ms) [ 20.271 mb/s]
27 | FixedWidth GenericParser 1.1 - Avg. Time 45.2 (ms) [ 37.134 mb/s]
28 |
29 | Completed Performance testing.
30 |
31 | <- Press Enter to Exit ->
32 |
--------------------------------------------------------------------------------
/Performance Results/1000_Rows.txt:
--------------------------------------------------------------------------------
1 | Number of iterations of data [1 iteration = 10 rows]: 100
2 |
3 | The following will generate performance information about the
4 | GenericParser class.
5 |
6 | Executions for each test: 10
7 | Rows of CSV Data: 1000
8 | Rows of FixedWidth Data: 1000
9 |
10 | <- Press Enter to Proceed ->
11 |
12 | Size of Csv data file: 141.60 kb
13 |
14 | Delimited MS Text Driver - Avg. Time 116.8 (ms) [ 1.184 mb/s]
15 | Delimited MS Text Field Parser - Avg. Time 55.2 (ms) [ 2.505 mb/s]
16 | Delimited CsvReader 3.7 - Avg. Time 4.1 (ms) [ 33.728 mb/s]
17 | Delimited GenericParser 1.0 - Avg. Time 6.2 (ms) [ 22.304 mb/s]
18 | Delimited GenericParser 1.1 - Avg. Time 4.8 (ms) [ 28.809 mb/s]
19 |
20 | ============================================
21 |
22 | Size of FixedWidth data file: 171.88 kb
23 |
24 | FixedWidth MS Text Driver - Avg. Time 110.0 (ms) [ 1.526 mb/s]
25 | FixedWidth MS Text Field Parser - Avg. Time 47.3 (ms) [ 3.549 mb/s]
26 | FixedWidth GenericParser 1.0 - Avg. Time 8.6 (ms) [ 19.517 mb/s]
27 | FixedWidth GenericParser 1.1 - Avg. Time 4.8 (ms) [ 34.968 mb/s]
28 |
29 | Completed Performance testing.
30 |
31 | <- Press Enter to Exit ->
32 |
--------------------------------------------------------------------------------
/Performance Results/100_Rows.txt:
--------------------------------------------------------------------------------
1 | Number of iterations of data [1 iteration = 10 rows]: 10
2 |
3 | The following will generate performance information about the
4 | GenericParser class.
5 |
6 | Executions for each test: 10
7 | Rows of CSV Data: 100
8 | Rows of FixedWidth Data: 100
9 |
10 | <- Press Enter to Proceed ->
11 |
12 | Size of Csv data file: 14.16 kb
13 |
14 | Delimited MS Text Driver - Avg. Time 83.0 (ms) [ 170.604 kb/s]
15 | Delimited MS Text Field Parser - Avg. Time 6.8 (ms) [ 2.034 mb/s]
16 | Delimited CsvReader 3.7 - Avg. Time 1.6 (ms) [ 8.643 mb/s]
17 | Delimited GenericParser 1.0 - Avg. Time 1.7 (ms) [ 8.134 mb/s]
18 | Delimited GenericParser 1.1 - Avg. Time 1.7 (ms) [ 8.134 mb/s]
19 |
20 | ============================================
21 |
22 | Size of FixedWidth data file: 17.19 kb
23 |
24 | FixedWidth MS Text Driver - Avg. Time 77.9 (ms) [ 220.635 kb/s]
25 | FixedWidth MS Text Field Parser - Avg. Time 5.3 (ms) [ 3.167 mb/s]
26 | FixedWidth GenericParser 1.0 - Avg. Time 1.1 (ms) [ 15.259 mb/s]
27 | FixedWidth GenericParser 1.1 - Avg. Time 0.7 (ms) [ 23.978 mb/s]
28 |
29 | Completed Performance testing.
30 |
31 | <- Press Enter to Exit ->
32 |
--------------------------------------------------------------------------------
/Performance Results/10_Rows.txt:
--------------------------------------------------------------------------------
1 | Number of iterations of data [1 iteration = 10 rows]: 1
2 |
3 | The following will generate performance information about the
4 | GenericParser class.
5 |
6 | Executions for each test: 10
7 | Rows of CSV Data: 10
8 | Rows of FixedWidth Data: 10
9 |
10 | <- Press Enter to Proceed ->
11 |
12 | Size of Csv data file: 1.42 kb
13 |
14 | Delimited MS Text Driver - Avg. Time 68.8 (ms) [ 20.582 kb/s]
15 | Delimited MS Text Field Parser - Avg. Time 2.0 (ms) [ 708.008 kb/s]
16 | Delimited CsvReader 3.7 - Avg. Time 2.2 (ms) [ 643.643 kb/s]
17 | Delimited GenericParser 1.0 - Avg. Time 2.1 (ms) [ 674.293 kb/s]
18 | Delimited GenericParser 1.1 - Avg. Time 1.4 (ms) [ 1011.440 kb/s]
19 |
20 | ============================================
21 |
22 | Size of FixedWidth data file: 1.72 kb
23 |
24 | FixedWidth MS Text Driver - Avg. Time 65.0 (ms) [ 26.442 kb/s]
25 | FixedWidth MS Text Field Parser - Avg. Time 1.0 (ms) [ 1.678 mb/s]
26 | FixedWidth GenericParser 1.0 - Avg. Time 0.3 (ms) [ 5.595 mb/s]
27 | FixedWidth GenericParser 1.1 - Avg. Time 0.3 (ms) [ 5.595 mb/s]
28 |
29 | Completed Performance testing.
30 |
31 | <- Press Enter to Exit ->
32 |
--------------------------------------------------------------------------------
/Performance Results/50000_Rows.txt:
--------------------------------------------------------------------------------
1 | Number of iterations of data [1 iteration = 10 rows]: 5000
2 |
3 | The following will generate performance information about the
4 | GenericParser class.
5 |
6 | Executions for each test: 10
7 | Rows of CSV Data: 50000
8 | Rows of FixedWidth Data: 50000
9 |
10 | <- Press Enter to Proceed ->
11 |
12 | Size of Csv data file: 6.91 mb
13 |
14 | Delimited MS Text Driver - Avg. Time 2359.2 (ms) [ 2.931 mb/s]
15 | Delimited MS Text Field Parser - Avg. Time 2657.6 (ms) [ 2.602 mb/s]
16 | Delimited CsvReader 3.7 - Avg. Time 130.1 (ms) [ 53.145 mb/s]
17 | Delimited GenericParser 1.0 - Avg. Time 246.9 (ms) [ 28.004 mb/s]
18 | Delimited GenericParser 1.1 - Avg. Time 171.1 (ms) [ 40.410 mb/s]
19 |
20 | ============================================
21 |
22 | Size of FixedWidth data file: 8.39 mb
23 |
24 | FixedWidth MS Text Driver - Avg. Time 2278.2 (ms) [ 3.684 mb/s]
25 | FixedWidth MS Text Field Parser - Avg. Time 2314.7 (ms) [ 3.626 mb/s]
26 | FixedWidth GenericParser 1.0 - Avg. Time 434.2 (ms) [ 19.328 mb/s]
27 | FixedWidth GenericParser 1.1 - Avg. Time 232.9 (ms) [ 36.034 mb/s]
28 |
29 | Completed Performance testing.
30 |
31 | <- Press Enter to Exit ->
32 |
--------------------------------------------------------------------------------
/Performance Results/Performance Tests.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AndrewRissing/GenericParsing/6ef9b494c2f1cef387721cf41d4e6e952ea9fa9f/Performance Results/Performance Tests.xlsx
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # GenericParser
2 |
3 | GenericParser is a .NET implementation of a parser for delimited and fixed width format files.
4 |
5 | ## Get Started
6 |
7 | Install the [latest Nuget package](https://www.nuget.org/packages/GenericParsing).
8 |
9 | Instantiate an instance of the parser:
10 |
11 | ```csharp
12 | using (GenericParser parser = new GenericParser(filePath))
13 | {
14 | while (parser.Read())
15 | {
16 | string id = parser["ID"];
17 | string name = parser["Name"];
18 | string status = parser["Status"];
19 |
20 | // Your code here ...
21 | }
22 | }
23 | ```
24 |
25 | See below for more examples.
26 |
27 | ## GenericParser Features
28 |
29 | * Efficient
30 | * Excellent unit test coverage
31 | * Supports delimited and fixed-width formats
32 | * For delimited, any custom delimited of a single character is supported
33 | * Supports comment rows (single character marker)
34 | * Supports escape characters (single character only)
35 | * Supports a custom text qualifier to allow column/row delimiters to be ignored (e.g., multi-line data)
36 | * Supports escaped text qualifiers by doubling them up
37 | * Supports ignoring/including rows that contain no characters
38 | * Supports a header row
39 | * Supports the ability to dynamically add more columns to match the data
40 | * Supports the ability to enforce the number of columns to a specific number
41 | * Supports the ability to enforce the number of columns based on the first row
42 | * Supports trimming the strings of a column
43 | * Supports stripping off control characters
44 | * Supports reusing the same instance of the parser for different data sources
45 | * Supports TextReader and String (the file location) as data sources
46 | * Supports limiting the maximum number of rows to read
47 | * Supports customizing the size of the internal buffer
48 | * Supports skipping rows at the beginning of the data after the header row
49 | * Supports XML configuration to configure the parser
50 | * Supports access to data via column name (when a header row is supplied)
51 | * Supports Unicode encoding
52 |
53 | ## GenericParserAdapter Features (Extends GenericParser)
54 |
55 | * Supports skipping rows at the end of the data
56 | * Supports adding a line number to each row
57 | * Supports the following outputs - XML, DataTable, and DataSet
58 |
59 | ## GenericParser - Examples
60 |
61 | * Parsing file from disk
62 |
63 | ```csharp
64 | using (GenericParser parser = new GenericParser(filePath))
65 | {
66 | while (parser.Read())
67 | {
68 | string id = parser["ID"];
69 |
70 | // Your code here ...
71 | }
72 | }
73 | ```
74 |
75 | * Parsing file from stream
76 |
77 | ```csharp
78 | using (GenericParser parser = new GenericParser(stream))
79 | {
80 | // ...
81 | }
82 | ```
83 |
84 | ## GenericParserAdapter - Examples
85 |
86 | * Parsing file into a DataSet
87 |
88 | ```csharp
89 | using (GenericParserAdapter parser = new GenericParserAdapter(filePath))
90 | {
91 | var dsResult = parser.GetDataSet();
92 | }
93 | ```
--------------------------------------------------------------------------------
/SolutionVersionInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 |
3 | [assembly: AssemblyVersion("1.2.2.*")]
4 | [assembly: AssemblyFileVersion("1.2.2.0")]
--------------------------------------------------------------------------------