|
-
Jun 16th, 2006, 11:46 PM
#1
Thread Starter
Member
sorting and merging of 2 sequnetial 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
"David","UK","4"
"Doanald","SA","3"
"Mardona","Argentina",""
"Pele","Brazil",""
"Ronaldo","Brazil","10"
"Schnider","Germany","2"
Pl Help
Regards
Samyo
Last edited by si_the_geek; Jun 17th, 2006 at 08:04 AM.
Reason: added vbcode tags for readability
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
|