read table like tail -f a log?

Subject: read table like tail -f a log?Message-Id: Date: Fri, 22 Nov 2013 14:44:46 +0800To: Kdb+ Personal Developers Mime-Version: 1.0 (Mac OS X Mail 7.0 (1822))X-Mailer: Apple Mail (2.1822)Hi, EveryoneI want to display a table data in the console like tail -f a log in UNIX.c?est bizzarre :)Anyone knows?Roy

You could set up

.z.ts:{show select[-10] from t;};
\t 1000

If you wanted new rows only you’d need to maintain state and select only newest rows.

Hi 

You could use .z.vs to track and print it.  Probably best to just keep a list of stuff you are interested in tracking rather than everything. 

q)monitorlist:t1t2`t3                                                                                                                                                                                                  

q)counters:(symbol$())!long$()                                                                                                                                                                                         

q).z.vs:{[x;y] if[x in monitorlist; -1"variable “,(string x),” has been updated with :“; show (0^counters;0W) sublist value x; -1"”; counters:count value x];}                                                     

q)t1:(a:0 1 2)                                                                                                                                                                                                         

variable t1 has been updated with :

a

0

1

2

q)`t1 insert (a:10 11)                                                                                                                                                                                                 

variable t1 has been updated with :

10

11

3 4

q)`t1 insert (a:20 30)                                                                                                                                                                                                 

variable t1 has been updated with :

20

30

5 6

q)t2:(a:xy`z)                                                                                                                                                                                                        

variable t2 has been updated with :

a

x

y

z

q)t4:(a:xy`z)         

q)

Thanks

Jonny

-100#select from table where date=max date.

On Friday, November 22, 2013 12:20:45 PM UTC+5:30, manish patel wrote:

You could set up

.z.ts:{show select[-10] from t;};
\t 1000

If you wanted new rows only you’d need to maintain state and select only newest rows.

On 22 Nov 2013 06:45, <liuch…@gmail.com> wrote:

Hi, Everyone

I want to display a table data in the console like tail -f a log in UNIX.

c’est bizzarre :)

Anyone knows?

Roy


Submitted via Google Groups