After getting the content value of a txt file in real time and calculating it, if it meets the condition then execute another batch program? Please advise.
Storage directory:d:\record
txt filenames:Ter2008Y4M16D12h.txt
Ter2008Y4M16D13h.txt
Ter2008Y4M16D14h.txt
Ter2008Y4M16D15h.txt
:
: one such file is generated every hour.
The txt format is: ( one line is generated every second as a record, the time interval can be specified, for example one line every 3 minutes,
and each time I need to take the value in the last column of the latest record.)
682 2008-4-16 15:00:00 26.75
683 2008-4-16 15:00:01 26.75
684 2008-4-16 15:00:02 26.75
685 2008-4-16 15:00:03 27.25
686 2008-4-16 15:00:04 27.25
687 2008-4-16 15:00:05 27
688 2008-4-16 15:00:06 27
689 2008-4-16 15:00:07 27.25
690 2008-4-16 15:00:08 26.75
691 2008-4-16 15:00:09 27.5
692 2008-4-16 15:00:10 27.5
693 2008-4-16 15:00:12 26.75
694 2008-4-16 15:00:13 27.5
695 2008-4-16 15:00:14 27.25
696 2008-4-16 15:00:15 27
697 2008-4-16 15:00:16 27
698 2008-4-16 15:00:17 27.25
699 2008-4-16 15:00:18 27.25
700 2008-4-16 15:00:19 27.5
701 2008-4-16 15:00:20 27.25
702 2008-4-16 15:00:21 27.25
703 2008-4-16 15:00:22 27.25
Now what I need is: can a program monitor in real time (or every 3 minutes) and get the value in the last column of the newest txt file, and if the value is greater than 30 then automatically execute another batch program; and every day automatically compress all txt files generated on the previous day under d:\record
into another directory, stored as a compressed file named with the previous date. For example: d:\rardata\%date%-1.rar
[ Last edited by qwertl on 2008-9-2 at 08:54 PM ]
Storage directory:d:\record
txt filenames:Ter2008Y4M16D12h.txt
Ter2008Y4M16D13h.txt
Ter2008Y4M16D14h.txt
Ter2008Y4M16D15h.txt
:
: one such file is generated every hour.
The txt format is: ( one line is generated every second as a record, the time interval can be specified, for example one line every 3 minutes,
and each time I need to take the value in the last column of the latest record.)
682 2008-4-16 15:00:00 26.75
683 2008-4-16 15:00:01 26.75
684 2008-4-16 15:00:02 26.75
685 2008-4-16 15:00:03 27.25
686 2008-4-16 15:00:04 27.25
687 2008-4-16 15:00:05 27
688 2008-4-16 15:00:06 27
689 2008-4-16 15:00:07 27.25
690 2008-4-16 15:00:08 26.75
691 2008-4-16 15:00:09 27.5
692 2008-4-16 15:00:10 27.5
693 2008-4-16 15:00:12 26.75
694 2008-4-16 15:00:13 27.5
695 2008-4-16 15:00:14 27.25
696 2008-4-16 15:00:15 27
697 2008-4-16 15:00:16 27
698 2008-4-16 15:00:17 27.25
699 2008-4-16 15:00:18 27.25
700 2008-4-16 15:00:19 27.5
701 2008-4-16 15:00:20 27.25
702 2008-4-16 15:00:21 27.25
703 2008-4-16 15:00:22 27.25
Now what I need is: can a program monitor in real time (or every 3 minutes) and get the value in the last column of the newest txt file, and if the value is greater than 30 then automatically execute another batch program; and every day automatically compress all txt files generated on the previous day under d:\record
into another directory, stored as a compressed file named with the previous date. For example: d:\rardata\%date%-1.rar
[ Last edited by qwertl on 2008-9-2 at 08:54 PM ]


