com.partnersoft.v3x.text
Class CSVUtils

java.lang.Object
  extended by com.partnersoft.v3x.text.CSVUtils

public class CSVUtils
extends java.lang.Object

parse CSV this class parses a CSV strings and files and does things with them it is tryin' to be a static method havin' utility class


Constructor Summary
CSVUtils()
           
 
Method Summary
static int countLines(java.io.File filet)
          Counts the lines in a file.
static int countLines(java.io.Reader source)
          Counts the lines in a CSV stream.
static void main(java.lang.String[] argv)
           
static java.util.ArrayList parseCSV(java.lang.String s)
          this will parse a comma delimited string and return a vector full of its values
static void parseCSV(java.lang.String s, java.util.ArrayList v)
          Recycling is good for you.
static java.util.Map parseCSVIntoMap(java.lang.String s, java.util.ArrayList keys)
          This parses a comma-delimited string and returns a Map where the values are keyed to the values in the keyArrayList parameter, in the same order.
static java.util.ArrayList parseListOfLists(java.lang.String string)
          This is a little weird; it parses a list of csv lists; each list is surrounded by parens.
static void writeCSV(java.io.PrintWriter outie, java.util.Collection collection)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVUtils

public CSVUtils()
Method Detail

main

public static void main(java.lang.String[] argv)

parseCSV

public static java.util.ArrayList parseCSV(java.lang.String s)
this will parse a comma delimited string and return a vector full of its values


parseListOfLists

public static java.util.ArrayList parseListOfLists(java.lang.String string)
This is a little weird; it parses a list of csv lists; each list is surrounded by parens.


parseCSV

public static void parseCSV(java.lang.String s,
                            java.util.ArrayList v)
Recycling is good for you. This will parse a comma delimited string and stick the results in your ArrayList.


parseCSVIntoMap

public static java.util.Map parseCSVIntoMap(java.lang.String s,
                                            java.util.ArrayList keys)
This parses a comma-delimited string and returns a Map where the values are keyed to the values in the keyArrayList parameter, in the same order.


countLines

public static int countLines(java.io.File filet)
                      throws java.io.IOException
Counts the lines in a file. Actually, it just counts linefeeds, so could be used for other purposes.

Throws:
java.io.IOException

countLines

public static int countLines(java.io.Reader source)
                      throws java.io.IOException
Counts the lines in a CSV stream. Actually, it just counts linefeeds, so could be used for other purposes.

Throws:
java.io.IOException

writeCSV

public static void writeCSV(java.io.PrintWriter outie,
                            java.util.Collection collection)