23 lines
552 B
JavaScript
23 lines
552 B
JavaScript
const file = Bun.file('./data.csv');
|
|
|
|
const results = {};
|
|
for (const line of (await file.text()).split('\n').slice(1)) {
|
|
if (line.trim() === '') {
|
|
continue;
|
|
};
|
|
|
|
const [industry, market, worker_rating, active_members, show_rate] = line.replaceAll('%', '').split(',');
|
|
if (!results[industry]) {
|
|
results[industry] = {}
|
|
}
|
|
if (!results[industry][market]) {
|
|
results[industry][market] = {}
|
|
}
|
|
|
|
results[industry][market] = {
|
|
worker_rating,
|
|
active_members,
|
|
show_rate
|
|
};
|
|
}
|
|
console.log(JSON.stringify(results, null, 3));
|