Rajat Sharma
Member
Hello everyone, hope you are doing well!!
I want to retrieve all the data from two different files (abc & abc1 in our example) at the same time.
If I do something like that (please refer below code for this) then I could get only first line from both of the files and if I surround input from with repeat block then it would be an infinite kind of loop.
I thought that we could achieve this by using different streams, I had been trying to do the same with streams but faced the same problem as mentioned above.
Please suggest.
Thanks & Regards!
Rajat.
I want to retrieve all the data from two different files (abc & abc1 in our example) at the same time.
If I do something like that (please refer below code for this) then I could get only first line from both of the files and if I surround input from with repeat block then it would be an infinite kind of loop.
Code:
def var s-path as char init "c:\rajat\abc.txt" no-undo.
def var s-path2 as char init "c:\rajat\abc1.txt" no-undo.
def var l-line as char no-undo.
def var l-line2 as char no-undo.
/* if I use REPEAT block here then it’s going into an infinite loop */
input from value(s-path).
import unformatted l-line.
message l-line
view-as alert-box.
input from value(s-path2).
import unformatted l-line2.
message l-line2
view-as alert-box.
input close.
I thought that we could achieve this by using different streams, I had been trying to do the same with streams but faced the same problem as mentioned above.
Code:
def var s-path as char init "c:\rajat\abc.txt" no-undo.
def var s-path2 as char init "c:\rajat\abc1.txt" no-undo.
def var l-line as char no-undo.
def var l-line2 as char no-undo.
def stream s-abc.
def stream s-abc1.
/* if I use REPEAT block here then it’s going into an infinite loop */
input stream s-abc from value(s-path).
import stream s-abc l-line.
message l-line view-as alert-box.
input stream s-abc1 from value(s-path2).
import stream s-abc1 l-line2.
message l-line2 view-as alert-box.
/*Closing streams*/
Please suggest.
Thanks & Regards!
Rajat.