fixed with file load - loading first row as column names .

Hi , 

I am using below to load a flat file to KDB . It loads succesfully, however is loading the first row of file as column names . I want to define the columns seperately instead. 

q)width:“?79?1?3?8?8?8?2?12?28?2?20?181?12?7?9?12?46?105?5?113?1?861?4?530?10?10?5?”

q)types:“SSSSSSSSSSSSSSSSSSSSSSSSSSS”

q)m:(types;width) 0:`testfile

If I try definiong the columns , getting below error



q)names:`Dummy1`BuySell`Dummy2`Dummy3`TradeDate`MaturityDate`PriceFractional`Price`Dummy5`QtyFractional`Qty`Dummy6`Isin`Dummy7`Cusip`Dummy8`TradeId`Dummy9`Timestamp`Dummy10`CancelDueToAmend`Dummy11`TransactionType`Dummy12`OrignatingId`Origin`Dummy13



<font color='"#000000"'><span style='"font-size:'>q)m1:flip names!(types;width) 0:`testtomefile<br></span></font>



    'length





THanks

Suraj

Take a step backwards to try and find the nonconforming length error. without the data ourselves to test load, it will be a pain to debug, so it’s [mostly] up to you

some things you can check

//identify count of columns of the dictionary after your load

count (types;width) 0:`testtomefile

//is the answer 27 as per your load requirement?

//identify count of records loaded into each column

count each (types;width) 0:`testtomefile

//is the distinct result of this a single number? it should be as all columns should be off same length before the flip

HTH,

Sean