KingSencat
asked on
Retrieve the last 1000 characters from a .txt file using Visual Basic v6.0
I need to retrieve the last 1000 characters(Not lines) from a .txt file, how can i do that with visualbasic ?
ASKER
I need to return those 1000 characters back to my visual basic project
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Am I missing something?
zf
zf
ASKER
its show blank, i have attached the text document for you, any idea why is not working?
Game10.txt
Game10.txt
Wow lol thats some file. My eyes hurt. Ok are you using the first or second retrevial?
This one
strLast1000 = right(fileload(strMyFile), 1000)
or this one
strLast1000 = Right(Replace(FileLoad(str MyFile), vbCrLf, ""), 1000)
zf
This one
strLast1000 = right(fileload(strMyFile),
or this one
strLast1000 = Right(Replace(FileLoad(str
zf
And now that I have you rfile I will test here as well. In addition to which retreval you rusing are you trying to place into a variable? textbox? other
zf
zf
ASKER
I want just to create a new file with the last 1000 characters :) thanks for your help
No problem, you have it working now?
zf
zf
ASKER
No :( its just blank
ASKER
what i am doing wrong?
Hi KingSenCat,
I am truly sorry for not getting back sooner. Work went south in a hurry today and turned into the second Monday of the week. Got home about 30 min ago and am going to bed.
I will readdress this with you tomorrow and help you figure out whats going on. First glance I think its the data in the file not being true text formatting not sure but we will get it worked out.
zf
I am truly sorry for not getting back sooner. Work went south in a hurry today and turned into the second Monday of the week. Got home about 30 min ago and am going to bed.
I will readdress this with you tomorrow and help you figure out whats going on. First glance I think its the data in the file not being true text formatting not sure but we will get it worked out.
zf
strLast1000 = right(fileload(strMyFile),
zf
*note you may also want to replace(vbcrlf, "") first to remove end of line
strLast1000 = Right(Replace(FileLoad(str
Open in new window