Capstone 2 1.7 Fail missmatch type error

https://learninghub.kx.com/forums/topic/capstone-2-1-3-and-1-7-fail-niy-error

1.7 fail


code:


/ Step 1.7

csvPath: getenv[`AX_WORKSPACE], "/FP.Data/message.csv";


/ Load the CSV file and store it in a table named messages

messages: ("I S") 0: csvPath; / 'I' for trade_id (int) and 'S' for exch_message (string)


messages: update trade_id_str: string trade_id from messages;



any suggestions?

Can you please share a screenshot of what you are running and the error? I cannot see from the code snippet what exactly you have run (apologies this formatting issue on the forum is due to be fixed soon).


Bit mismatch error indicates your column is one datatype and the data you're trying to add is different datatype.


Here is what meta messages returns and the first few rows of the table if that helps.

Here's the attached screenshot. Thank you!

Does line 36 run for you? I would think that would throw a type error as you'e passing a string to hsym. https://code.kx.com/q/ref/hsym/


Can you print out values of csvPath, meta messages and first few lines of messages in console and send screenshot?

here's the console ss, It throws nyi (not implemented yet) error for
"first 10 messages"

Hi Nayan,

This is an example format of how you should load in a CSV file:

t:("SFI";enlist",") 0: `$csvPath
  • No spaces between the column types
  • The use of 'enlist' which is the delimiter used to return the CSV as a table

Use this format to adjust your answer accordingly. If you have any further questions, please let me know :)

Thanks,

Megan