T
T
Torento203452021-03-22 18:42:31
JavaScript
Torento20345, 2021-03-22 18:42:31

How to open csv file as object?

How to get values ​​from csv tables as object or arrays?
When opened, it is a continuous endless text that is not separated in any way, except for chaotic commas.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2021-03-22
@Torento20345

data = "1,2,3\n4,5,6\n7,8,9";
data = data.split("\n").map(x=>x.split(","));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question