csv and infinity

Hello:
   I have a csv using 3014-01-01 to represent infinity positive date, when I use (“D”; “,”)  0: `:file.csv , I got null, 

I tried to replace 3014-01-01 with 0Wd in file.csv, still get the same.  Any help?

Thank in advance.

Hi Hao,

Suppose x11.csv contains date (1/1/3014) so when we import this in q table it will show blank as NULL using meta. To show null, first we have to convert it into string and then replace by 0Nd (for date)

x11.csv

c1c2

112/1/2014

21/1/3014

312/1/2014

412/1/2014

p:update string c2 from (“ID”;enlist “,”) 0:`x11.csv

meta p

p1:update ct:count each c2 from p

select c1,c2 from (update c2:enlist “0Nd” from p1 where ct=0)

c1 c2


1  “2014.12.01”

2  “0Nd”

3  “2014.12.01”

4  “2014.12.01”

Thanks

Hemant

Thank you Hemant.
Another way is to use sed to replace 3014-xx-yy with 2200-01-01, which can be scanned by 0:  and also works for me.


Hi Hao,


q) d:2290.12.25 + til 10

q) (date:d;s:string d;p:“D”$stringd)

From the above code, you can see kdb willparse the date after 2290.12.31 as null

So you may update the table filled with 0wd


q) update 0wd^p from (date:d;s:stringd;p:“D”$string d)


Angel Ng