Re: [racket-users] appending files

2016-01-26 Thread Benjamin Greenman
On Tue, Jan 26, 2016 at 1:32 AM, Neil Van Dyke wrote: > you want to do "filename globbing" There's also the glob package [1], which should give the exact same API as the shell. No need to remember the trailing "$" or specifically exclude dotfiles. (require glob) (glob

Re: [racket-users] appending files

2016-01-25 Thread George Neuner
On 1/26/2016 12:39 AM, Scotty C wrote: here's what i'm doing. i make a large, say 1 gb file with small records and there is some redundancy in the records. i will use a hash to identify duplicates by reading the file back in a record at a time but the file is too large to hash so i split it.

Re: [racket-users] appending files

2016-01-25 Thread Robby Findler
You might want to use copy-port here. Robby On Mon, Jan 25, 2016 at 11:50 PM, Benjamin Greenman wrote: > If you don't mind all the indentation, this one is streaming. > > (define (concat file* destination) > (with-output-to-file destination #:exists 'append >

Re: [racket-users] appending files

2016-01-25 Thread Neil Van Dyke
Scotty C wrote on 01/26/2016 12:39 AM: i know that i can do this in a linux terminal window with the following: cat mytmp*.dat >> myoriginal.dat. i'd like to accomplish this from within the program by shelling out. can't figure it out. other methodologies that are super fast will be

[racket-users] appending files

2016-01-25 Thread Scotty C
here's what i'm doing. i make a large, say 1 gb file with small records and there is some redundancy in the records. i will use a hash to identify duplicates by reading the file back in a record at a time but the file is too large to hash so i split it. the resultant files (10) are about 100 mb

Re: [racket-users] appending files

2016-01-25 Thread Benjamin Greenman
If you don't mind all the indentation, this one is streaming. (define (concat file* destination) (with-output-to-file destination #:exists 'append (lambda () ;; 'cat' each file (for ([f (in-list file*)]) (with-input-from-file f (lambda () (for ([ln