I'm have a hard time with VB and try to use SQL to do the things I need to do. I'm stuck on this one and need a row number added to a text file. I found this code searching the internet, and think it will work. The problem I have is I can't get it working in VB. I'm getting it needs a subMain error. I'm not sure where (how) the file is named. Should this have a button?

Here is an example of what I'm trying to accomplish.

I have an ascii file that has records of varying length:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbb
ccccccccccccccccccccccccccccccccccccccccc
dddddddddddddddddddddd
eeeeeee
fff
ggggggggggggggggggggggggggggggggggggggggggggggggg

I need to add a leading sequence number to these transactions, with padded zeros. So the output will look like this:

000001aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
000002bbbbbbbbbbbbbbbbbbb
000003ccccccccccccccccccccccccccccccccccccccccc
000004dddddddddddddddddddddd
000005eeeeeee
000006fff
000007ggggggggggggggggggggggggggggggggggggggggggggggggg