Skip to content

Instantly share code, notes, and snippets.

View chbaranowski's full-sized avatar

Christian Baranowski chbaranowski

View GitHub Profile
@chbaranowski
chbaranowski / KeyValueParser.scala
Created June 23, 2012 06:44 — forked from clhodapp/KeyValueParser.scala
Scala RegEx Parser Demo
import scala.util.parsing.combinator.RegexParsers
/**
* Simple parser for a key value string like:
* key01 = Value01 key02=value02 key03 =value03 key04= value04
*
* The parser does not support whitespace in key or values.
*/
object KeyValueParser extends RegexParsers {
@chbaranowski
chbaranowski / CsvConvertor.java
Created June 4, 2011 19:16 — forked from RainerW/csvconvertor.groovy
Convert a CSV file into another CSV format in Java.
import java.io.*;
public class CsvConvertor {
public static void main(String[] args) throws Exception {
FileWriter out = new FileWriter("output.csv");
BufferedReader in = new BufferedReader(new FileReader("input.csv"));
String line;
while ((line = in.readLine()) != null) {
String[] fields = line.split(";");
String name = fields[2];