Hello, I would appreciate some help to import data from a text file to a datagridview.
If anyone could give me a hint to get started...
The textfiles have the column name in the "[ ]"
I would like to read the data after the [wp], [pos], [rad] blocks, the data inside [] is not needed in the datagridview.
My problem is that I don't know where to start, If I need to read line by line, and strip the text after reading?

Sample of textfile:

[route] "350 Mongstad - Aasgard C"

[wp] "H Graa"
[pos] 605100.00 0042600.00
[rad] 1852.00

[wp] "Holmen"
[pos] 605530.00 0041000.00
[rad] 1852.00

[wp] "Stad"
[pos] 625400.00 0041000.00
[rad] 1852.00

Thanks for any hints..

Recommended Answers

All 2 Replies

Use the string Split method. Here is some explanation to help you on the way. Success!

Thank you, your link helped me out.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.