I require to extract specific column's data from CSV file and output should also be a CSV format. I have gone through many solutions about extracting data from CSV but none of them talks about extracting it in CSV format itself
Example :
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
string filePath = "abc.csv";
string csvContnet = File.ReadAllText(filePath);
// E.g. Suppose above csv has 9 columns
// And column headers are from A,B,C...I
// Now I want to select data from columheaders B,C and F along with header
string requiredCsvContent = this.GetRequiredCsvContent(csvContnet);
}
/// <summary>
/// Following function returns required CSV content from main csv File
/// </summary>
/// <param name="csvContnet"></param>
/// <returns></returns>
private string GetRequiredCsvContent(string csvContnet)
{
}}