I am trying to write down to a hdb directory at different times duringthe day such that at end of day I have a complete HDB.My issue occurs with one table I have that has a list of symbols..Q.dpft saves this table fine at end of day but I am struggling tofind a way to append for this table intraday.{.[hdbtabdir;();,;.Q.en[`:.]`. x]}[`table]The above works for all tables except the one with the list.Any advice how I can append to this table on disk intraday such thatat end of day I will have the same result as .Q.dpft?
To: personal-kdbplus@googlegroups.comX-Mailer: Apple Mail (2.1084)On Sep 14, 2011, at 4:25 AM, Daniel wrote:> My issue occurs with one table I have that has a list of symbols.> .Q.dpft saves this table fine at end of day but I am struggling to> find a way to append for this table intraday.> > {.[hdbtabdir;();,;.Q.en[:.]
. x]}[table]details?at a guess try{@[hdbtabdir;x;,;.Q.en[
:.]. x]}[
table]
here’s a modified version of .Q.dpft for appending.
q)k)append :?{[d;p;t]if[~&/.Q.qm’r:+.Q.en[d]. t;'
unmappable];{[d;t;x]@[d;x;,;t]}[d:.Q.par[d;p;t];r]'!r;@[d;`.d;:;!r];t}
q)append[hdbdtabdir;.z.D;`table]
At the end of the day, you might want to do a sort and put a parted attr on sym col.
regards,
pawan
You can write a function like thisinsertIntradayData:{[dir;t] .[.Q.par[dir;.z.d;t];();,;.Q.en[dir;t]]}function takes 2 params i.e., hdb base dir and tableAjayOn Sep 14, 1:25?pm, Daniel <cas...> wrote:> I am trying to write down to a hdb directory at different times during> the day such that at end of day I have a complete HDB.>> My issue occurs with one table I have that has a list of symbols.> .Q.dpft saves this table fine at end of day but I am struggling to> find a way to append for this table intraday.>> {.[hdbtabdir;();,;.Q.en[
:.]. x]}[
table]>> The above works for all tables except the one with the list.>> Any advice how I can append to this table on disk intraday such that> at end of day I will have the same result as .Q.dpft?</cas…>
Thanks for the suggestions.Pawan’s solution is what I was looking to do.On Sep 14, 10:11?am, Ajay <rathore.a…> wrote:> You can write a function like this>> insertIntradayData:{[dir;t] .[.Q.par[dir;.z.d;t];();,;.Q.en[dir;t]]}>> function takes 2 params i.e., hdb base dir and table>> Ajay>> On Sep 14, 1:25?pm, Daniel <cas...> wrote:>>>> > I am trying to write down to a hdb directory at different times during> > the day such that at end of day I have a complete HDB.>> > My issue occurs with one table I have that has a list of symbols.> > .Q.dpft saves this table fine at end of day but I am struggling to> > find a way to append for this table intraday.>> > {.[hdbtabdir;();,;.Q.en[
:.]. x]}[
table]>> > The above works for all tables except the one with the list.>> > Any advice how I can append to this table on disk intraday such that> > at end of day I will have the same result as .Q.dpft?- Hide quoted text ->> - Show quoted text -</cas…></rathore.a…>