I need to read a binary file (say abc.bin). Then search within the file for sync words (say 3600,475,3622,479). Each word is 12 bits long.
After each sync word, the next 256 words are to be copied to a file in the first row, the next 256 words to the next row etc. After the 4th Sync word the 1st Sync word will repeat.

Any help will be appreciated. I am using VB6.


Okay, first start a new standard exe project and then press F1. When help comes up, click on the index tab and type in the following...

FreeFile Function
Open Statement
Get Function
Input Function
Line Input Function 'for future as with what you have described this cannot be used
Close Statement

Don't forget to click on Example when there is one. Then if you need more examples, you could always use your friends (yahoo, google, ask, answers, bing) and search for the above.

Now, once you have that digested and are starting to understand what code you will need to write, you will have to make a decision on which method you use to read the file in. The choice I am talking about is between the Get Function and the Input Function. Now, if the size of the file is quite large then the Get Function may have to do, but if the file is smaller, you may be able to use the Input Function and read the whole file in, as this would be faster to process the contents of the file.

Good Luck