Currently, I am developing a dashboard web application and utilizing Papa Parse to parse a CSV file provided by the client.
The parsing functionality is working smoothly, with data being logged in the console using a callback function.
My task now is to extract and store the values at the 10th position of the last 2 rows (note that the number of rows may vary) into two separate JavaScript variables, which will then be displayed in the HTML.
Any assistance or suggestions on how to achieve this would be greatly appreciated!
Here is the existing code snippet:
function showData(data) {
console.log(data);
console.log(data.item);
}
function parseData(url, callBack) {
Papa.parse(url, {
download: true,
dynamicTyping: true,
complete: function(results) {
callBack(results.data);
}
});
}
Below are the array results from the parser:
22205: (105) ["c:\Users\admin\Documents\IxChariot\Tests\8ss_hk_test_udp.tst", "4ss", 4215, 4215, 17337500000, null, 3067971000, 14269529000, 82.304, 204.118, 0.385, 1946.667, null, ...]
22206: (105) ["c:\Users\admin\Documents\IxChariot\Tests\8ss_hk_test_udp.tst", "8ss", 17922, 17922, 18512800000, null, 13073661980, 5439138020, 29.38, 869.816, 0.394, 696.907, null, ...]