cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble With CSV Import

Mike_Thompson
New Contributor
I'm having trouble importing a CSV file. Values for one of thecolumns is sometimes coming through as null, but shouldn't be:q) pathToCsv: `:test.csvq) t: ("IHDSUU"; enlist ",") 0: pathToCsvNow I check to see if 'end' column has come in correctly:q) select from t where null endid s wc days start end--------------------------------------1679 5332 2009.11.29 1111111 18:001680 5332 2009.11.22 1111111 18:001676 5332 2009.12.20 1111111 18:001678 5332 2009.12.06 1111111 18:001677 5332 2009.12.13 1111111 18:001098 5232 2009.11.29 0000001 12:001099 5232 2009.11.22 0000001 12:001095 5232 2009.12.20 0000001 12:001097 5232 2009.12.06 0000001 12:001096 5232 2009.12.13 0000001 12:002765 5732 2009.11.29 1111111 04:00..Arrgh. Some rows (not all) have a null 'end'. But the correspondingentries in the CSV file do not. The nulls are wrong.I'm completely stumped.Does anyone have any ideas?test.csv is available here (it's small): http://bucket432.s3.amazonaws.com/test.csvCheers,Mike
2 REPLIES 2

charlie
New Contributor II
New Contributor II
times are out of rangee.g 24:30 --> 00:30, 21:60 --> 22:00 ?404,5210,2009.12.06,0000001,23:30,24:30231,5210,2009.11.29,0000001,23:30,24:301679,5332,2009.11.29,1111111,18:00,21:601680,5332,2009.11.22,1111111,18:00,21:601676,5332,2009.12.20,1111111,18:00,21:601678,5332,2009.12.06,1111111,18:00,21:601677,5332,2009.12.13,1111111,18:00,21:60On Thu, Nov 19, 2009 at 2:57 PM, Mike Thompson wrote:> I'm having trouble importing a CSV file. �Values for one of the> columns is sometimes coming through as null, but shouldn't be:>> q) �pathToCsv: `:test.csv> q) �t: ("IHDSUU"; enlist ",") 0: pathToCsv>> Now I check to see if 'end' column has come in correctly:>> q) select from t where null end> id � s � �wc � � � � days � �start end> --------------------------------------> 1679 5332 2009.11.29 1111111 18:00> 1680 5332 2009.11.22 1111111 18:00> 1676 5332 2009.12.20 1111111 18:00> 1678 5332 2009.12.06 1111111 18:00> 1677 5332 2009.12.13 1111111 18:00> 1098 5232 2009.11.29 0000001 12:00> 1099 5232 2009.11.22 0000001 12:00> 1095 5232 2009.12.20 0000001 12:00> 1097 5232 2009.12.06 0000001 12:00> 1096 5232 2009.12.13 0000001 12:00> 2765 5732 2009.11.29 1111111 04:00> ..>> Arrgh. �Some rows (not all) have a null 'end'. �But the corresponding> entries in the CSV file do not. �The nulls are wrong.>> I'm completely stumped.>> Does anyone have any ideas?>> test.csv is available here (it's small): �http://bucket432.s3.amazonaws.com/test.csv>> Cheers,> Mike>> -->> You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.> To post to this group, send email to personal-kdbplus@googlegroups.com.> To unsubscribe from this group, send email to personal-kdbplus+unsubscribe@googlegroups.com.> For more options, visit this group at http://groups.google.com/group/personal-kdbplus?hl=.>>>

On Nov 20, 1:25�am, Charles Skelton wrote:> times are out of range> e.g 24:30 --> 00:30, 21:60 --> 22:00 ?>> 404,5210,2009.12.06,0000001,23:30,24:30> 231,5210,2009.11.29,0000001,23:30,24:30> 1679,5332,2009.11.29,1111111,18:00,21:60> 1680,5332,2009.11.22,1111111,18:00,21:60> 1676,5332,2009.12.20,1111111,18:00,21:60> 1678,5332,2009.12.06,1111111,18:00,21:60> 1677,5332,2009.12.13,1111111,18:00,21:60>Ahhh, thank you, thank you.Times like "24:30" are okay - our 24 hour clock goes from 06:00 to25:59 (don't ask). But "21:60" is definitely wrong. That's theproblem.I just can't believe I stared at this, and experimented, and swore foras long as I did and didn't see it.--Mike