Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27358

Text from file to multiple Arrays

$
0
0
Good Morning,

I am attempting to read this data from a text file and turn each line into a separate arrays...

MIA JFK HNL LAX DFW
-5 -5 -10 -8 -6
0 3 12 8 2.5
3 0 14 8.5 3.5
12 12 0 4.5 8.5
8 8.5 4.5 0 3.5
2.5 3.5 8.5 3.5 0

The first line would be inserted into an array like {MIA,JFK,HNL,LAX,DFW}
Second line a new array with {-4, -4, -10, -7, -5}
And the last lines would be inserted into a two dimensional array:
{{0, 3, 12, 8, 2.5}, _
{3, 0, 14, 8.5, 3.5}, _
{12, 14, 0, 4.5, 8.5}, _
{8, 8.5, 4.5, 0, 3.5}, _
{2.5, 3.5, 8.5, 3.5, 0}}

I have been struggling for over two days with this. This solution is probably easy... but it is evading me. I have tried using the streamreader to no avail.


Any help would be greatly appreciated.

Viewing all articles
Browse latest Browse all 27358

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>