Need Footer in csv file #1489
Unanswered
rakeshmahur
asked this question in
Q&A
Replies: 2 comments
-
After you're done writing, however you would like to do that, just write another row. csv.WriteRecord(footer);
csv.NextRecord(); or csv.WriteField("recordcound");
csv.WriteField(records.Count);
csv.NextRecord(); |
Beta Was this translation helpful? Give feedback.
0 replies
-
If you are using the pattern from the tutorial: using (var writer = new StreamWriter("path\\to\\file.csv"))
using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture))
{
csv.WriteRecords(records);
} Then you can write anything to the using (var writer = new StreamWriter("path\\to\\file.csv"))
using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture))
{
csv.WriteRecords(records);
writer.WriteLine($"recordcount | {records.Count}");
} You need to be careful when you are reading from that file, though, either through |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I need footer with record count in csv file as below:
applicationid | name | city
1 | rakesh | delhi
2 | jon | london
recordcount | 2
how can i create csv in this format.
Beta Was this translation helpful? Give feedback.
All reactions