Skip to content

Commit 4c8e268

Browse files
committed
Initial commit
This is a very basic CSV parser, which I may expand upon for its 1.0.0 release. The code comes from a school project from a while back, and I have already experienced 1 bug when using it (which I have resolved) in another project.
0 parents  commit 4c8e268

File tree

13 files changed

+859
-0
lines changed

13 files changed

+859
-0
lines changed

.gitattributes

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Handle line endings automatically for files detected as text
2+
# and leave all files detected as binary untouched.
3+
* text=auto
4+
5+
#
6+
# The above will handle all files NOT found below
7+
#
8+
# These files are text and should be normalized (Convert crlf => lf)
9+
*.css text
10+
*.df text
11+
*.htm text
12+
*.html text
13+
*.java text
14+
*.js text
15+
*.json text
16+
*.jsp text
17+
*.jspf text
18+
*.jspx text
19+
*.properties text
20+
*.sh text
21+
*.tld text
22+
*.txt text
23+
*.tag text
24+
*.tagx text
25+
*.xml text
26+
*.yml text
27+
28+
# These files are binary and should be left untouched
29+
# (binary is a macro for -text -diff)
30+
*.class binary
31+
*.dll binary
32+
*.ear binary
33+
*.gif binary
34+
*.ico binary
35+
*.jar binary
36+
*.jpg binary
37+
*.jpeg binary
38+
*.png binary
39+
*.so binary
40+
*.war binary

.gitignore

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
2+
# Created by https://www.gitignore.io/api/java,linux,macos,gradle,windows,eclipse,intellij+all
3+
4+
### Eclipse ###
5+
6+
.metadata
7+
bin/
8+
tmp/
9+
*.tmp
10+
*.bak
11+
*.swp
12+
*~.nib
13+
local.properties
14+
.settings/
15+
.loadpath
16+
.recommenders
17+
18+
# External tool builders
19+
.externalToolBuilders/
20+
21+
# Locally stored "Eclipse launch configurations"
22+
*.launch
23+
24+
# PyDev specific (Python IDE for Eclipse)
25+
*.pydevproject
26+
27+
# CDT-specific (C/C++ Development Tooling)
28+
.cproject
29+
30+
# Java annotation processor (APT)
31+
.factorypath
32+
33+
# PDT-specific (PHP Development Tools)
34+
.buildpath
35+
36+
# sbteclipse plugin
37+
.target
38+
39+
# Tern plugin
40+
.tern-project
41+
42+
# TeXlipse plugin
43+
.texlipse
44+
45+
# STS (Spring Tool Suite)
46+
.springBeans
47+
48+
# Code Recommenders
49+
.recommenders/
50+
51+
# Scala IDE specific (Scala & Java development for Eclipse)
52+
.cache-main
53+
.scala_dependencies
54+
.worksheet
55+
56+
### Eclipse Patch ###
57+
# Eclipse Core
58+
.project
59+
60+
# JDT-specific (Eclipse Java Development Tools)
61+
.classpath
62+
63+
### Intellij+all ###
64+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
65+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
66+
67+
# User-specific stuff:
68+
.idea/**/workspace.xml
69+
.idea/**/tasks.xml
70+
.idea/dictionaries
71+
72+
# Sensitive or high-churn files:
73+
.idea/**/dataSources/
74+
.idea/**/dataSources.ids
75+
.idea/**/dataSources.xml
76+
.idea/**/dataSources.local.xml
77+
.idea/**/sqlDataSources.xml
78+
.idea/**/dynamic.xml
79+
.idea/**/uiDesigner.xml
80+
81+
# Gradle:
82+
.idea/**/gradle.xml
83+
.idea/**/libraries
84+
85+
# CMake
86+
cmake-build-debug/
87+
88+
# Mongo Explorer plugin:
89+
.idea/**/mongoSettings.xml
90+
91+
## File-based project format:
92+
*.iws
93+
94+
## Plugin-specific files:
95+
96+
# IntelliJ
97+
/out/
98+
99+
# mpeltonen/sbt-idea plugin
100+
.idea_modules/
101+
102+
# JIRA plugin
103+
atlassian-ide-plugin.xml
104+
105+
# Cursive Clojure plugin
106+
.idea/replstate.xml
107+
108+
# Ruby plugin and RubyMine
109+
/.rakeTasks
110+
111+
# Crashlytics plugin (for Android Studio and IntelliJ)
112+
com_crashlytics_export_strings.xml
113+
crashlytics.properties
114+
crashlytics-build.properties
115+
fabric.properties
116+
117+
### Intellij+all Patch ###
118+
# Ignores the whole idea folder
119+
# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
120+
121+
.idea/
122+
123+
### Java ###
124+
# Compiled class file
125+
*.class
126+
127+
# Log file
128+
*.log
129+
130+
# BlueJ files
131+
*.ctxt
132+
133+
# Mobile Tools for Java (J2ME)
134+
.mtj.tmp/
135+
136+
# Package Files #
137+
*.jar
138+
*.war
139+
*.ear
140+
*.zip
141+
*.tar.gz
142+
*.rar
143+
144+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
145+
hs_err_pid*
146+
147+
### Linux ###
148+
*~
149+
150+
# temporary files which can be created if a process still has a handle open of a deleted file
151+
.fuse_hidden*
152+
153+
# KDE directory preferences
154+
.directory
155+
156+
# Linux trash folder which might appear on any partition or disk
157+
.Trash-*
158+
159+
# .nfs files are created when an open file is removed but is still being accessed
160+
.nfs*
161+
162+
### macOS ###
163+
*.DS_Store
164+
.AppleDouble
165+
.LSOverride
166+
167+
# Icon must end with two \r
168+
Icon
169+
170+
# Thumbnails
171+
._*
172+
173+
# Files that might appear in the root of a volume
174+
.DocumentRevisions-V100
175+
.fseventsd
176+
.Spotlight-V100
177+
.TemporaryItems
178+
.Trashes
179+
.VolumeIcon.icns
180+
.com.apple.timemachine.donotpresent
181+
182+
# Directories potentially created on remote AFP share
183+
.AppleDB
184+
.AppleDesktop
185+
Network Trash Folder
186+
Temporary Items
187+
.apdisk
188+
189+
### Windows ###
190+
# Windows thumbnail cache files
191+
Thumbs.db
192+
ehthumbs.db
193+
ehthumbs_vista.db
194+
195+
# Folder config file
196+
Desktop.ini
197+
198+
# Recycle Bin used on file shares
199+
$RECYCLE.BIN/
200+
201+
# Windows Installer files
202+
*.cab
203+
*.msi
204+
*.msm
205+
*.msp
206+
207+
# Windows shortcuts
208+
*.lnk
209+
210+
### Gradle ###
211+
.gradle
212+
**/build/
213+
214+
# Ignore Gradle GUI config
215+
gradle-app.setting
216+
217+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
218+
!gradle-wrapper.jar
219+
220+
# Cache of project
221+
.gradletasknamecache
222+
223+
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
224+
# gradle/wrapper/gradle-wrapper.properties
225+
226+
227+
# End of https://www.gitignore.io/api/java,linux,macos,gradle,windows,eclipse,intellij+all
228+
229+
### Symphony ###
230+
run/

LICENSE.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2018, Jamie Mansfield <https://jamiemansfield.me/>
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
csv
2+
===
3+
4+
csv is a basic CSV parser written in pure Java, licensed under the 3-clause BSD license.
5+
6+
### Usage
7+
8+
csv is such a small library that it is best demonstrated with an example.
9+
10+
```java
11+
try (final CsvParser parser =
12+
new CsvParser(Files.newBufferedReader(Files.get("example.csv")))) {
13+
for (final CsvRow row : parser.parse()) {
14+
System.out.println(row.getValue("name"));
15+
}
16+
} catch (final IOException ex) {
17+
ex.printStackTrace();
18+
}
19+
```

0 commit comments

Comments
 (0)