check out the left and mid functions
Printable View
check out the left and mid functions
here's code that will work:
VB Code:
dim buff as string Open "C:\your file.txt" for binary as #1 buff = space(500) get #1,,buff open "C:\first part.txt" for binary as #2 put #2,,buff close #2 buff = space(200) get #1,loc(1),buff open "C:\2nd part.txt" for binary as #2 put #2,,buff close #2 buff = space(lof(1)) get #1,loc(1),buff open "C:\3rd part.txt" for binary as #2 put #2,buff close #2 close #1
test it and see if i had made any spelling mistakes in there.
I got it all working, thanks all for your help... Specially James Stanich for the speedy reply and 'B.P' cause that's exactly what I wanted, lol. :D
yes it's amazing.... i didn't even write it in VB........
Well, though the above method works, but I actually encourage
u to do like this:
VB Code:
Open File1$ For Binary As #1 FirstDat = Input$(500, #1) SecondDat = Input$(200, #1) 'ThirdDat could be retrieved in three ways ThirdDat = Input$(LOF(#1) - 700, #1) ThirdDat = Input$(LOF(#1) - (Len(FirstDat) + Len(SecondDat)), #1) ThirdDat = Input$(LOF(#1) - LOC(#1) + 1, #1) Close #1 'Write the dats to the corresponding files