VB.net | Save data from DataGridView to text file (Line per line)
<p>The application I designed so far has a DataGridView which loads data from a text file line per line.</p>

<p>All I want is for the code to save the (first row, first column) on the first line as a string, then (first row, second column) on the second line, etc.</p>

<p>Here is an example of what my table looks like:</p>

<pre><code>|-------------------------------------------------------|
|  ID  |  Date  |  Height  |  Weight  |  BMI  |  Units  |
|-------------------------------------------------------|
|  01  | 16/06  |   1.74   |    64    | 20.9  | Metric  |
|  02  | 17/06  |   1.74   |    63    | 20.6  | Metric  |
|-------------------------------------------------------|
</code></pre>

<p>So from this example, after the data has been saved to the text file it should look exactly like this:</p>

<pre><code>01
16/06
1.74
64
20.9
Metric
02
17/06
1.74
63
20.6
Metric
</code></pre>

<p>I came across some excellent code which does this with tabs, instead of a next line, here it is:</p>

<pre><code>dgvMeasures.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText
dgvMeasures.SelectAll()
IO.File.WriteAllText(fileName, dgvMeasures.GetClipboardContent.GetText.TrimEnd)
dgvMeasures.ClearSelection()
</code></pre>

<p>NOTE: The DataGridView is called dgvMeasures</p>

<p>Also please note that I cannot provide anything that I have already tried since there is nothing I can do, I have no idea what to do.</p>

<p>So if there is anyone who could help, it would be greatly appreciated</p>