Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1008
  • Last Modified:

rewind a file

I want to rewind a file to the beginning.  Is there a command equivalent to the rewind command in C for VB.  If not, without closing the file and opening it again, how would one do this?
0
LJ083198
Asked:
LJ083198
  • 2
1 Solution
 
steve06Commented:
LJ,

What you could do is to open the file with the mode "Binary" (Open FileName.txt for Binary ), and then use the command Get to restart from the beginning of the file.

BTW, I don't see what's wrong with closing a file and reopening it right away ...

Steve.
0
 
LJ083198Author Commented:
Because I have to bounce each record in the file off of this other file and there are 2,000 records.  It seems to take longer when i close and reopen for each record.
0
 
mark2150Commented:
If the records are fixed length and you know the record number you can use the SEEK command to reposition the pointer in the file without having to close & reopen. Will be *MUCH* faster esp if disk file can be cached.
0
 
mark2150Commented:
BTW: SEEK to 0 will rewind the file if you need to do a sequential search.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now