Skip to content

Commit

Permalink
feat: add unescape functionality to person template csv parsing (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabynevada authored Nov 21, 2023
1 parent 6b5c13d commit 98afac3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Biomatch.CLI/Csv/PersonRecordTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static class PersonRecordTemplate
{
public static IEnumerable<IPersonRecord> ParseCsv(string csvFilePath)
{
using var reader = Sep.New(',').Reader(o => o with { }).FromFile(csvFilePath);
using var reader = Sep.New(',').Reader(o => o with { Unescape = true }).FromFile(csvFilePath);
foreach (var readRow in reader)
{
yield return new PersonRecord(
Expand Down
7 changes: 2 additions & 5 deletions src/Biomatch.CLI/Csv/PotentialMatchTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ namespace Biomatch.CLI.Csv;

public static class PotentialMatchTemplate
{
public static async Task WriteToCsv(
IEnumerable<PotentialMatch> potentialMatches,
string csvFilePath
)
public static Task WriteToCsv(IEnumerable<PotentialMatch> potentialMatches, string csvFilePath)
{
var csvContent = new StringBuilder();
const string header =
Expand Down Expand Up @@ -67,6 +64,6 @@ string csvFilePath
csvContent.AppendLine(line);
}

await File.WriteAllTextAsync(csvFilePath, csvContent.ToString());
return File.WriteAllTextAsync(csvFilePath, csvContent.ToString());
}
}

0 comments on commit 98afac3

Please sign in to comment.