Append something entered to a file?

#1
I have a long-running batch file which produces a log file. I can interrupt the batch file's main loop (by looking at keystrokes) and do administrative things (set parameters with ESET, get status info, et c.) then continue. I'd like to add the ability to put a hand-written notation in the log file.

So how do I get TCC to accept text from the keyboard and when I'm done (Enter or Ctrl-Z?) write it to a file? [This seems like an ancient technique which I have simply forgotten.]
 
#2
---- Original Message ----
From: vefatica
To: [email protected]
Sent: Monday, 2011. February 28. 23:02
Subject: [Support-t-2639] Append something entered to a file?

| I have a long-running batch file which produces a log file. I can
| interrupt the batch file's main loop (by looking at keystrokes) and
| do administrative things (set parameters with ESET, get status info,
| et c.) then continue. I'd like to add the ability to put a
| hand-written notation in the log file.
|
| So how do I get TCC to accept text from the keyboard and when I'm
| done (Enter or Ctrl-Z?) write it to a file? [This seems like an
| ancient technique which I have simply forgotten.]

INPUT?
--
Steve
 
#5
On Mon, 28 Feb 2011 23:44:00 -0500, TEA-Time <> wrote:

|Code:
|---------
|< keyboard >> file [press Ctrl-Z when done]
|---------
|Am I thinking of UNIX?
|---End Quote---
|COPY CON?

That may be what I was thinking of. Can it append to the file?
 
Aug 9, 2009
133
0
#6
> -----Original Message-----
> From: vefatica
> Sent: Tuesday, 1 March 2011 5:03 p.m.
> Subject: [Support-t-2639] Append something entered to a file?
>
> I have a long-running batch file which produces a log file. I can
> interrupt the batch file's main loop (by looking at keystrokes) and
> do administrative things (set parameters with ESET, get status info,
> et c.) then continue. I'd like to add the ability to put a
> hand-written notation in the log file.
>
> So how do I get TCC to accept text from the keyboard and when I'm
> done (Enter or Ctrl-Z?) write it to a file? [This seems like an
> ancient technique which I have simply forgotten.]
@fileopen[]
querybox %%stuff
@fileclose[]
 
Aug 9, 2009
133
0
#7
-----Original Message-----
From: Kach [mailto:[email protected]]
Sent: Tuesday, 1 March 2011 7:05 p.m.
To: Kach
Subject: RE: [Support-t-2639] Append something entered to a file?


forgot to write that stuff ......lol


> -----Original Message-----
> From: Kach [mailto:[email protected]]
> Sent: Tuesday, 1 March 2011 6:54 p.m.
> To:
> Subject: RE: [Support-t-2639] Append something entered to a file?
>
>
> > -----Original Message-----
> > From: vefatica
> > Sent: Tuesday, 1 March 2011 5:03 p.m.
> > Subject: [Support-t-2639] Append something entered to a file?
> >
> > I have a long-running batch file which produces a log file. I can
> > interrupt the batch file's main loop (by looking at keystrokes) and
> > do administrative things (set parameters with ESET, get status info,
> > et c.) then continue. I'd like to add the ability to put a
> > hand-written notation in the log file.
> >
> > So how do I get TCC to accept text from the keyboard and when I'm
> > done (Enter or Ctrl-Z?) write it to a file? [This seems like an
> > ancient technique which I have simply forgotten.]
>
set open_0=%@fileopen[%@unique[],w,t]
querybox /e %%stuff
set w=%@filewrite[%open_0,%stuff]
echo %@fileclose[%open_0]
 
Jun 2, 2008
302
1
#8
On Mon, 28 Feb 2011 23:44:00 -0500, TEA-Time <> wrote:

|Code:
|---------
|< keyboard >> file [press Ctrl-Z when done]
|---------
|Am I thinking of UNIX?
|---End Quote---
|COPY CON?

That may be what I was thinking of. Can it append to the file?
Good question... I guess it does. See the Appending Files section in COPY's help.

COPY test.txt+CON

..appends what's entered to an existing test.txt.
 
#9
On Tue, 01 Mar 2011 01:13:36 -0500, TEA-Time <> wrote:

|That may be what I was thinking of. Can it append to the file?
|---End Quote---
|Good question... I guess it does. See the Appending Files section in COPY's help.
|
|COPY test.txt+CON
|
|..appends what's entered to an existing test.txt.

Thanks! That seems arcane/obscure but it does what I want. The problem with
INPUT/ESET is that later, you's have to ECHO the variable to a file and any
special characters would cause big problems.

Another question: You end "COPY test.txt+CON" with Ctrl-Z. Is there a way to
prevent the Ctrl-Z from winding up in the file (another way to terminate the
input)? I haven't considered it in about 20 years, but today, putting Ctrl-Z in
a file seems very odd (especially if **any** software is later going to consider
it EOF).
 
Nov 2, 2008
197
1
#12
It depends on how things are added to the file by the batches.

Ye should use the same method, eg echo 'text' >> logfile

You could set a subroutine 'note' that simply takes text from the command line, and add it to the file.