Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open all the contents in a folder, copy their content, move orginal fo

Status
Not open for further replies.

croag

MIS
Nov 8, 2001
49
US
Hello,

Here's what I'm up to today!

I'm trying to copy the contents of multiple PXP Files (recordbased inhouse format) that all reside in a directory that is being watched by a filesystemwatcher. Once the .created or .changed event is triggered this fuction will open each file, copy its contents line by line to a 'daily PXP file' that has a timestap in its filename, and then the orginal file will be moved into an 'original' directory to hold the orignal PXP files just in case! Here's what I have so far and the psuedo code is what I believe I need. If its not, Please feel free to change things around..Thanks!!
<code>
Public Function StripAppend(ByVal infile as String)

dim strm as filestream = File.Create(watchfolder.path & Date.Today & ".PXP")
strm.Close()
File.Open(1, watchfolder.Path.ToString & Date.Today & ".pxp", FileMode.append) ' this is the Daily file that will hold the contents of the multhat will be created if it doesn't exsist
For Each PXPinDirectory
File.Open(write content of eachpxpfile, to 1)
Move each file to (watchfole.path & "Original\&)
File.close
Next
<code>

well.as you can see...I need some help. Is my logic right? Syntax (obviously the syntax isn't)

Thanks in advance!!! yeah!!! Thank you!

croag !!
 
Anyone have any idea on this....please help me ! I just need a little direction!
 
The logic seems ok. But you need to be carefull that the files you are trying to read arent locked by another user.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top