VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Grab data / text / from one file and dump it to another with only a couple lines of code. No API. W

by revega (5 Submissions)
Category: Windows System Services
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Originally Published: Wed 5th June 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Grab data / text / from one file and dump it to another with only a couple lines of code. No API. Works will all VB's

Rate Grab data / text / from one file and dump it to another with only a couple lines of code. No API. W



'** Copy one file into another
'** Compatible with all Winblows versions of 
'** Visual Basic.
'**
'** From:  revega  May 06, 2002
'------------------------------------------     
'
' Put this inside a command button or menu


On Error GoTo stopIT

Open "c:\test.txt" For Input As #1     'your input file
Open "c:\output.txt" For Output As #2  'output file

'Note that the output file doesn't have to be created
'first because it will be created automaticly.
'Becareful too because this will overwrite the output
'file if it exists without prompting you.

go:

    Input #1, A$  'Grab text
    If EOF(1) Then GoTo grabLastLine  'Check for end of file
    Print #2, A$  'Put text           'if EOF then get the
                                      'last line of text.
GoTo go

grabLastLine: Print #2, A$

stopIT:  Close #1: Close #2           'Close files

Download this snippet    Add to My Saved Code

Grab data / text / from one file and dump it to another with only a couple lines of code. No API. W Comments

No comments have been posted about Grab data / text / from one file and dump it to another with only a couple lines of code. No API. W. Why not be the first to post a comment about Grab data / text / from one file and dump it to another with only a couple lines of code. No API. W.

Post your comment

Subject:
Message:
0/1000 characters