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
I've used Split function
Which displays
"Ronaldo","Brazil"
"David","UK"
"Pele","Brazil"
"Mardona","Argentina"
"Doanald","SA"
"Schnider","Germany"
====Suppose Here i add Two More recs. in Add.Dat file
"Mohamed","Saudi Arabia"
"Richard","USA"
Goals.Dat File I let it remain same
"Ronaldo","10"
"David","4"
"Doanald","3"
"Schnider","2"
What happens i GET the result as follows using the code given by Static
"David","UK","4"
"Doanald","SA","3"
"Mardona","Argentina","" "Mohamed","Saudi Arabia"
"Pele","Brazil","" "Richard","USA"
"Ronaldo","Brazil","10"
"Schnider","Germany","2"
Now I want the result as follows using Split given by Static
By merging above two files and get The specific result as Follows "David","UK","4"
"Doanald","SA","3"
"Mardona","Argentina",""
"Mohamed","Saudi Arabia",""
"Pele","Brazil",""
"Richard","USA",""
"Ronaldo","Brazil","10"
"Schnider","Germany","2"
Pl help me to modify the Code Given by Static
Hello Static
Yes At Present I am manually puting the data.
What difference does it make if i put the data manually directly in the file
or Later develop code with where from Two text box i can put the data.
No Matter If Ubound increases in File Add.dat Your Routine should work
What happens is that it in Add.Dat Ubound(LinesAdd) = 8
Where as Ubound(LinesGoal) = 4 JUST SEE THE DATA
I've just put goal of each players with's it name and their goals
those are only displayed in the "Players.dayt"but why not the players name also with blank goals.
Thats where i want to merge file Players where it is combined.
Are u telling me that ubound in both files should be equal ?
Do i change the names$ in goal.dat to Lnames$ ?
What do u mean by reading Final before adding lines?
or How do I read Final before adding linesa .Pl specify
I really dont understand what have you send in the Form load
something is missing in the form load
Pl tell where is the LinesAdd function in your code which you sent me
WHETHER ON FORM-LOAD OR CMD1_CLICK
STILL I AM FACING THE SAME
WHY DONT YOU TRY THE RESULT FOR YOUR SELF
Pl see the following result
What happens i GET the result as follows using the "David","UK","4"----- see the the 3 Variables
"Doanald","SA","3"------ see the the 3 Variables
"Mardona","Argentina",""----see the 3 variables
Goals=0 "Mohamed","Saudi Arabia",----see the 2 variables
AS NO RECORDS IN
GOALS.DAT
"Pele","Brazil",""---------see the 3 variables
Goals=0 "Richard","USA"---------SEE ONLY 2 VARIABLES
AS NO RECORDS IN
GOALS.DAT
"Ronaldo","Brazil","10"-------see the 3 variables
"Schnider","Germany","2"-------see the 3 variables
Now I want the result as follows using Split given by Static
IT SHOULD CONTAIN THREE VARIABLES
OTHERWISE I WILL GET ERROR INPUT PAST END
IF I WANT TO READ FILE
?? im looking at Final.dat and it has 3 variables in it...
"Ronaldo","Brazil","10",""
"David","UK","4",""
"Mohamed","Saudi Arabia",""
"Pele","Brazil","",""
"Mardona","Argentina","",""
"Doanald","SA","3",""
"Schnider","Germany","2",""
"Richard","USA",""
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
DEAR STATIC
HOW IT TAKES 3 VARAIBLES I THINK YOU AR FORGETING ,""
OR JUST COUNT DELIMETERS OR COMMAS
records "Mohamed","Saudi Arabia",""
1 , 2 , 3 ----> PRINTS THREE VARIABLES , 2 COMMAS
"Richard","USA",""
1 , 2 , 3----> PRINTS THREE VARIABLES , 2 COMMAS
"Ronaldo","Brazil","10",""
1 , 2 , 3 , 4 PRINTS FOUR VARIABLES , 3 COMMAS
"David","UK","4",""
AND OTHER RECORDS PRINTS FOUR VARIABLES, 3 COMMAS
WHEN WE MERGE I WANT ALL RECORDS WITH FOUR VARIABLES AND THREE COMMAS