PDA

View Full Version : VBA help with parsing a file



reddeh
07-12-2013, 06:01 PM
I am new to the world of VBA and I am making my first attempt at writing code. I have looked though the forum and the problem I’m having doesn’t seem to be there. Any advice or guidance in the right direction would be greatly appreciated.

I have a text file that is inputted in the following format:
1, 100, 100, 100, EOR
2, 110, 120, 100, EOR
3, 200, 200, 100, CL
4, 210, 250, 100, CL

I currently have a loop splitting these into their proper categories:
Ptnumber =result (0)
Easting = result (1)
Northing = result (2)
Elevation = result (3)
Description = result (4)

I have figured out how to draw points and label text in autocad however my ultimate goal is to parse my text file by description. I would like all of my “EOR” descriptions to be assigned one variable and all of my “CL” to be a different variable. I then want to draw a line between the points for “EOR” and the points for “CL”.

I’m unsure of how to get to this point.