MCPcopy Create free account
hub / github.com/breck7/scroll / parseCSV

Function parseCSV

updatePopularity.js:25–37  ·  view source on GitHub ↗
(filePath)

Source from the content-addressed store, hash-verified

23
24// Function to read and parse CSV files
25function parseCSV(filePath) {
26 const content = fs.readFileSync(filePath, "utf-8")
27 const rows = content.split("\n")
28 rows.shift()
29 const data = {}
30 for (let row of rows) {
31 const [parserId, uses] = row.split(",")
32 if (parserId && uses) {
33 data[parserId] = (data[parserId] || 0) + parseInt(uses)
34 }
35 }
36 return data
37}
38
39// Function to merge data from multiple CSV files
40function mergeCSVData(filePaths) {

Callers 1

mergeCSVDataFunction · 0.85

Calls 2

splitMethod · 0.80
shiftMethod · 0.80

Tested by

no test coverage detected