|
-
Jun 15th, 2006, 12:03 AM
#1
Thread Starter
Member
[RESOLVED] Merging 2 Sequential files
Hello
Pl Help me with this simple solution
I want to merge two files How can i do it ?
VB Code:
OPEN "ADD.DAT" FOR INPUT AS#1
DO UNTIL EOF(1)
i% =i% + 1
if i% > ubound(Names$) then redim preserve Names$(1 to i%)
if i% > ubound(goals$) then redim preserve add$(1 to i%)
INPUT #1, Name$(i%), add$(i%)
LOOP
CLOSE #1
Which displays
"Ronaldo","Brazil"
"David","UK"
"Pele","Brazil"
"Mardona","Argentina"
"Doanald","SA"
"Schnider","Germany"
VB Code:
OPEN "Goals.Dat" FOR INPUT AS#1
DO UNTIL EOF(1)
s$=s%+1
if s% > ubound(Names$) then redim preserve Names$(1 to s%)
if s% > ubound(goals$) then redim preserve goals$(1 to s%)
INPUT #1, Names$(i%), goals$(i%)
LOOP
CLOSE #1
Which displays
"Ronaldo","10"
"David","4"
"Doanald","3"
"Schnider","2"
I want to merge above two files and get the result as
"Ronaldo","Brazil","10"
"David","UK","4"
"Pele","Brazil",""
"Mardona","Argentina",""
"Doanald","SA","3"
"Schnider","Germany","2"
Pl Help
Regards
Samyo
i% = 0
for i% = 0 to ubound(Name$)
FullGreeting$(i%) = Greeting$(i%) & ", " & Name$(i%)
next i
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|