CLS PRINT " Serial Data Decimater." PRINT PRINT " by Tim Nolan copyright 1999 " PRINT PRINT "Enter input file name (example: emeter.txt)" LINE INPUT infile$ 'get input file name OPEN infile$ FOR INPUT AS #1 'open that file for reading PRINT "Enter output file name (example: deci.txt)" LINE INPUT outfile$ 'get output file name OPEN outfile$ FOR OUTPUT AS #2 'open that file for writing PRINT "Enter number of seconds to skip between each entry:" INPUT decimate 'get number of entries to skip count = 0 PRINT "Reading data from "; infile$ PRINT "Number of entries (or seconds) to be skipped "; decimate PRINT "Writing out to file "; outfile$ PRINT DO LINE INPUT #1, edata$ 'read in line of data from file count = count + 1 'keep track of how many lines IF (count MOD decimate) = 0 THEN 'when no remainder time to write line PRINT #2, edata$ 'write line of data to file PRINT edata$ 'write line of data to screen END IF LOOP UNTIL EOF(1) 'keep on reading till end of file CLOSE #1 'close reading and writing file CLOSE #2 PRINT "Number of lines in input file = "; count PRINT "Program finished and files closed"