Skip to content

Commit

Permalink
Update importvolunteercsv to read delimiters for csv in bracer and co…
Browse files Browse the repository at this point in the history
…mmas

Update exportvolunteercsv to have compatibility with the import format
  • Loading branch information
Scrubbius committed Nov 6, 2018
1 parent d071a94 commit 279d5f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ private void createVolunteerCsv(ObservableList<Volunteer> list,

//appending column titles
sb.append("Name" + csvSplit);
sb.append("Gender" + csvSplit);
sb.append("Birthday" + csvSplit);
sb.append("Phone" + csvSplit);
sb.append("Address" + csvSplit);
sb.append("Email" + csvSplit);
sb.append("Birthday" + csvSplit);
sb.append("Gender" + csvSplit);
sb.append("Address" + csvSplit);
sb.append("Tags" + csvSplit);
sb.append("VolunteerID");
sb.append(System.getProperty("line.separator"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ public CommandResult execute(Model model, CommandHistory history) throws Command
try {
String currLine;
while ((currLine = br.readLine()) != null) {
String[] arrayLine = currLine.split(",");
String[] arrayLine = currLine.split(",(?=([^\"]*\"[^\"]*\")*[^\"]*$)");
String args = "";
for (String i : arrayLine) {
args += i + " ";
if (String i != null){
args += i + " ";
}
}
args = args.trim();
ArgumentMultimap argMultimap =
Expand Down

0 comments on commit 279d5f2

Please sign in to comment.