By "DOC" file do you mean MSWord? If that is the case you have to use Word to save the file in plain ASCII format. Then you open the resulting TXT file as before.
You can control Word directly from VFP using OLE Automation with:
oWord = createobject("Word.Application")
Now you have a pointer to MSWord and cand do everything Word can. You do not have to show Word to the user (oWord.visible = .f. which is the default) and can open the DOC and save it in text format.
If you don't know the Word commands to do that, just create a Word macro and go do it from Word, then look at the VBA code that the macro created. It is fairly simple to translate to VFP.
Of course, the computer running this code must have Word installed.
>>>>>>>>>>>>
can it be posible that instead of txt file i am using doc file but some unwanted stuff is comming how can i avoid it.
>>>>>>>>>>>>