Read from a csv file
See original GitHub issueI have a csv file uploaded in input type file and I want to read this file the exceljs but I don’t know how ? can you please help me with that. In the documentation it’s not mention how to read before prepossessing with exceljs this are the examples in the documentation :
// read from a file
var workbook = new Excel.Workbook();
workbook.csv.readFile(filename)
.then(function(worksheet) {
// use workbook or worksheet
});
// read from a stream
var workbook = new Excel.Workbook();
workbook.csv.read(stream)
.then(function(worksheet) {
// use workbook or worksheet
});
// pipe from stream
var workbook = new Excel.Workbook();
stream.pipe(workbook.csv.createInputStream());
This the begining of my code :
function ValidateFile(input) {
var files = input.files || [];
if (!files.length) return;
var file = files[0];
fileName = file.name;
//what to do here ???
var workbook = new Excel.Workbook();
workbook.csv.read(stream)
.then(function(worksheet) {
});
}
Wich one can I use and how ? Thank you.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:8
Top Results From Across the Web
csv — CSV File Reading and Writing — Python 3.11.1 ...
The csv module implements classes to read and write tabular data in CSV format. It allows programmers to say, “write this data in...
Read more >Reading and Writing CSV Files in Python - Real Python
Reading from a CSV file is done using the reader object. The CSV file is opened as a text file with Python's built-in...
Read more >Reading CSV files in Python - GeeksforGeeks
USing csv.reader(): At first, the CSV file is opened using the open() method in 'r' mode(specifies read mode while opening a file) which ......
Read more >Reading CSV files in Python - Programiz
Example 1: Read CSV files with csv.reader() ... Here, we have opened the innovators.csv file in reading mode using open() function. ... Then,...
Read more >Pandas Read CSV - W3Schools
Pandas Read CSV ; Load the CSV into a DataFrame: · pandas as pd df = pd.read_csv('data.csv') print(df.to_string()) ; Print the DataFrame without...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is really frustrating. Xlsx works really well in browser via the
load
method if you load anArrayBuffer
viaFileReader
, butload
is inexplicably missing for CSVs. I can’t imagine why, a correspondingwriteBuffer
method exists, why notload
??The need to load a csv file is always present on browser, even if it is slower or less efficient. It makes absolutely no sense why CSV requires a node environment but Xlsx does not.
Is there a chance to read csv and xlsx in browser?