Bigbadborris
Active member
- Joined
- Aug 21, 2013
- Messages
- 35
- Programming Experience
- Beginner
Hi all
I have a listbox wich displays the contents of a part build list the data is formatted as below
234c - DRIVE SHAFT
1C - GEARBOX CASTINGS
35A - DRIVE BEARING
1235A - PUMP
I have worked out how to extract the 1st 5 characters which is the part number from each line, trim the blank spaces. I would then like to write the part number to a text file. with all the part numbers in the build list on one line.
i.e 234C,1C,35A,1235A
when a new build list is written it needs to do the same but on the next line in the text file.
This is what I have so far but i can either get it to append the next build list of to the end of the 1st line entered, or it writes each part number on a seperate line
where am I going wrong
Many Thanks
I have a listbox wich displays the contents of a part build list the data is formatted as below
234c - DRIVE SHAFT
1C - GEARBOX CASTINGS
35A - DRIVE BEARING
1235A - PUMP
I have worked out how to extract the 1st 5 characters which is the part number from each line, trim the blank spaces. I would then like to write the part number to a text file. with all the part numbers in the build list on one line.
i.e 234C,1C,35A,1235A
when a new build list is written it needs to do the same but on the next line in the text file.
This is what I have so far but i can either get it to append the next build list of to the end of the 1st line entered, or it writes each part number on a seperate line
VB.NET:
Dim ObjWriter As New System.IO.StreamWriter(File_Name, True)
For Each Item As Object In lstBuildlist.Items
BuildPart = (Item)
BuildPartSplit = BuildPart.Substring(0, 5).Trim
ObjWriter.Write(BuildPartSplit & ",")
Next
ObjWriter.Close()
where am I going wrong
Many Thanks