2015.04.13 01:16 AM
2015.04.13 02:00 AM
2015.04.14 07:06 AM
Here is a very good twiki on loading from a list of csvs and creating as hdb...just modify your read to read in *.txt fileshope it goes well,Sean
2015.04.14 07:34 AM
2015.04.15 06:51 AM
2015.04.16 02:08 AM
Hi,I provided that link because it has the ability to load a list of files from an inputted directory. You just need to modify it to accept multiple dirs.Yes the link says "Loading From Large Files" , but the actual script is just a loader...http://code.kx.com/wsvn/code/cookbook_code/ dataloader/loader.q. The script also generates a partitioned hdb...which is what your question was.Whilst we are here, lets see what we can do...//create 2 dirs for filescd /var/tmpfor j in seano seano2 ; do for i in file1 file2; do touch $j/$i ; done ; done//pass in dirs into a cmd line paramq -dir /var/tmp/seano /var/tmp/seano2//create file list from these two dirs` sv/: raze foo,''key each foo:hsym each `$.Q.opt[.z.x]`dirOr focusing on the script...currently it hasinputdir:`:examplecsvloadallfiles[inputdir;1b]Change it toinputdir:`:examplecsv`:examplecsv2 loadallfiles[;1b] each inputdirThanks,Sean
On Monday, April 13, 2015 at 9:16:58 AM UTC+1, huangyu...@gmail.com wrote:Hi,suppose:q)dir1:`:/test;q)key dir1`20141201`20141202`....q)dir2:` sv dir,(key dir1) 0q)key dir2`IBM.txt`AMD.txt`....I should how to iterate through all the text files and generate partition hdb?Best regards,Sky.
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.