Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add unescape functionality to person template csv parsing #98

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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());
}
}