title: Write a text file with tab delimiter in .Net Core
body: <p>Hi do you have any guides, work aid or step by step how to export to text with tab delimited. Im using Asp.Net Core 2.2 MVC EF. I want to export a list from my
  <a href="https://i.stack.imgur.com/1uaIV.png" rel="nofollow noreferrer">table.</a>. I want to have a button where the user click in this DownloadFile Action will trigger.</p>
  
  <pre><code>public object DownloadFile()
          {
              var payments = new List&lt;BdoPE&gt;
              {
                  new BdoPE
                  {
                      DocDateInDoc = "01/01/2019",
                      DocType = "DZ",
                      CompanyCode = "3000",
                      PosDateInDoc = "01/01/2019",
                      FiscalPeriod = "01",
                      CurrentKey = "PHP",
                      RefDocNum = "Over-The-Counter",
                      DocHeadT = "BDO",
                      PosKeyInNextLine = "40",
                      AccMatNextLine = "11231131",
                      AmountDocCur = "0000000010050",
                      ValDate = "01/01/2019",
                      AssignNum = "EEA",
                      ItemText = "1000136212  ",
                      PosKeyInNextLine2 = "15",
                      AccMatNextLine2 = "0115027FF",
                      AmountDocCur2 = "0000000010050",
                      BaseDateDueCal = "01/01/2019",
                      ItemText2 = "1000136212"
                  },
              };
  
              // I want this part to let the user select where they want to save the text file.
              using (var writer = new StreamWriter("path\\to\\file.txt")) // not static location like this one.
  
              using (var csv = new CsvWriter(writer))
              {
                  csv.WriteHeader&lt;BdoPE&gt;();
                  csv.WriteRecord(payments);
              }
  
              // where should i put the delimiter part?
  
              return; // to what?
          }
  </code></pre>