Created
February 6, 2014 13:40
-
-
Save rdm/8844361 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'csv' | |
stordir=: <'c:\voxtst\' NB. note < and trailing \ | |
NB. Convert the csv file to a boxed J array | |
csvdata=: readcsv 'c:\voxtst\prophecy.csv' | |
NB. filenames | |
sourcefnames=: }. 0 {"1 csvdata | |
targetfnames=: stordir,each (}. 2 {"1 csvdata),each <'.wav' | |
assert (-: ~.) targetnames NB. unique file names | |
NB. uncomment next line to copy | |
NB. inspect results from above before proceeding | |
NB. targetfnames (fwrite~ fread)each sourcefnames |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alternate file copy mechanism:
status=: targetfnames fcopynew&> sourcefnames
status would typically be a two column result.
Column 0: _1 (copy failed), 0 (file previously copied), 1 (file successfully copied)
Column 1: length of file
If every attempt failed (for example if none of the source files existed) 'status' would instead be a list of _1s..