I think it's standard M but I know GT.M can do this. I've been writing a 
routine to take data from one file, clean up the format and output it to 
another. A portion of the code follows:

        s input="/home/Desktop/PATFILE.DAT"
        open input:(readonly)  <--- defines the read source
        s output="/home/Desktop/output.csv"
        open output:newversion  <--- defines the write source
        s delim=","
input   use input:exception="g EOF" <--- "use" command tells m which
        use input read x
        s y=$Piece(x,delim,17)
        s $Piece(name,delim,1)=$TR(y,"""")
        use output write !,name
        
EOF     close input <--- closes file when done
        goto quit

In testing, I used the "$Principal" variable to do writes to the 
terminal and reads from the 'input' file.

Mike Schrom

[EMAIL PROTECTED] wrote:
> Hi! I'm interested in being able to use different IO channels for Read 
> and Write, **without** changing the IO in between. That is, that Reads 
> would come from a certain device or host file or whatever, and Writes go 
> somewhere else. (In case you're interested, the reason is to be able to 
> write an automated testing wrapper for previously written code.) As far 
> as I know, this can't be done in standard M, at least in the varieties 
> I'm familiar with. But...
> 
> I wondered if maybe some of the standard Fileman utilities offer such an 
> ability. That is, can one initially set up input variables so that ^DIR 
> or ^DIC, say, Read from one device and Write to another, or globals (a 
> la EN^DDIOL), or some such?
> 
> This is just a shot in the dark, I have no reason to think these 
> utilities were set up this way, but maybe I'll get lucky.
> 
> Thanks,
> Michael Reach
> 
> 
> 
> ________________________________________________________________________
> Try Juno Platinum for Free! Then, only $9.95/month!
> Unlimited Internet Access with 1GB of Email Storage.
> Visit http://www.juno.com/value to sign up today!
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Hardhats-members mailing list
> Hardhats-members@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/hardhats-members

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Hardhats-members mailing list
Hardhats-members@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hardhats-members

Reply via email to