Outputting to a txt. file
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2007-04-05 02:50 PM
‎2007-04-05
02:50 PM
How do I rescript it so that this wont happen, at the minute I am exporting individual files to Access when instead it would be easier and quicker to just send 1.
This is part my script:
Executive script:
IF outdat THEN GOSUB 900: !File I/O
END
!----------------------------------------------------------------
900: ! File OUTPUT Routine
!Write Costings Access Report File
ch1= OPEN("TEXT", acost+".txt","SEPARATOR='\t',MODE=WO")
OUTPUT ch1, 1,0, "Description","Qty","Length","Type","Qty per Length","Cost/Unit","Cost","Weight (kg/m)","Weight/Unit (kg)","Total Weight (kg)"
OUTPUT ch1, 1,0, "Ball",nosections," ",ball*1000," ",F1,F1*(nosections),spherew,spherew,spherew*nosections
Close ch1
In parameters I tpye in the what name I want to call the file and this is related to: acost
1 REPLY 1
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2007-04-08 05:03 PM
‎2007-04-08
05:03 PM
Robert1083 wrote:MODE = WO overwrites the existing file
ch1= OPEN("TEXT", acost+".txt","SEPARATOR='\t',MODE=WO")
MODE = WA appends to the existing file
There may be quite a bit more to get this to work for you though, depending on just precisely what you want to do. Clearly you don't want to keep appending more and more data forever. The simplest thing might be to set the database to clear the contents when it reads the file.
Managing data through intermediary text files can be troublesome though. You might do better to use the interactive scheduler to extract the data for you.