Created
July 21, 2013 06:54
-
-
Save fourdollars/6047759 to your computer and use it in GitHub Desktop.
A little script to parse Email from Registrano's CSV output.
This file contains 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
#!/usr/bin/env lsc | |
require! csv | |
require! fs | |
speakers = [] | |
csv! | |
.from.stream fs.createReadStream __dirname + \/coscup2013-cfp.csv, do | |
delimiter: \, | |
escape: \" | |
.to.path __dirname + \/sample.out | |
.transform (row) -> | |
row.unshift row.pop! | |
row | |
.on \record, ! (row,index) -> | |
status = row.19 | |
if status == \允許:一般演講 or status == \座談會 | |
if row.4? and row.4 is not '' | |
speakers.push "#{row.4} (#{row.3}) <#{row.2}>" | |
else if row.3? and row.3 is not '' | |
speakers.push "#{row.3} <#{row.2}>" | |
.on 'end', ! (count) -> | |
console.log speakers.join ", " | |
# console.log 'Number of lines: ' + count | |
return | |
.on 'error', ! (error) -> | |
console.log error.message |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment