This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]; |