I am working on a script that converts a .txt file (non delimited) to an Excel spreadsheet. My problem occurs where I need to pull data that could be between 5-10 characters and there are several sets of data on each line.
Each line can have the following number of characters in each field and there are five fields to pull in each line:
10 char 10 char 10 char 17 char 10 char 523452 D918 20120418 1FD7X2XTACEB8963820120606 523874 L9117244 20120409 3C6TDT5H0CG12130200000000 535581 G700 20120507 5GYFUD CT 00000000
I basically need to be able to pull 10,10,10,17,10 and place them in their own cell in a row in Excel. I am able to pull the cells as it is now but its based on space delimitation and that causes a problem when the fields don’t take up the full amount of space and I end up with an Excel sheet with blank cells in it.
You can use
String.Substring(your tag readsC#):