Тёмный
No video :(

Working with XLSX in JavaScript 

Vincent Lab
Подписаться 3,3 тыс.
Просмотров 73 тыс.
50% 1

Опубликовано:

 

25 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 75   
@samuelhuang4324
@samuelhuang4324 3 года назад
I am only amazed at the kind of content and examples you give. This is super helpful and continue to deliver more great content Vincent :)
@VincentLabStudio
@VincentLabStudio 3 года назад
Happy to hear that!
@nickersonlauriston1582
@nickersonlauriston1582 2 года назад
Thank you soooo much. You've showed me more in 5 minutes than hours of documentation. Thank you for your work.
@VincentLabStudio
@VincentLabStudio 2 года назад
Glad it was helpful!
@Chandan7404
@Chandan7404 3 года назад
Thank you for the tutorial. Finally I realized that you actually meant "New Column" by "New Row".
@VincentLabStudio
@VincentLabStudio 3 года назад
Thank you for pointing it out. I always confuse rows and columns. I've changed the project files, but I can't really do anything about the video.
@Chandan7404
@Chandan7404 3 года назад
@@VincentLabStudio In my country(🇧🇩) we have RC Cola (alongside Coca Cola and Pepsi Cola) which helps us remember that "R" comes as the first subscription number and then "C". 😄 ... thank you again all your videos. Hope to see more in coming days. en.wikipedia.org/wiki/RC_Cola
@VincentLabStudio
@VincentLabStudio 3 года назад
​@@Chandan7404 Fun fact thanks 😄
@user-ip6cb5qw4v
@user-ip6cb5qw4v 2 года назад
This can help me in the future project. thank you very much!
@user-kc5zo1xu2h
@user-kc5zo1xu2h Год назад
This video is very helpful for me. Thanks.
@abelmurua6980
@abelmurua6980 2 года назад
Great explanation on this library!
@VincentLabStudio
@VincentLabStudio 2 года назад
Thank you!
@Rauletzu699
@Rauletzu699 11 месяцев назад
I'm new to this. Do I need to download / install / src something in order to use fs, xlsx and jsontoxml?
@sephiroLord
@sephiroLord 3 месяца назад
This might be a dumb question, but is it possible for excel doc to be an api source? And if so. Can you point me to a resource
@jgvlc
@jgvlc 2 года назад
Thank you very much!
@marcinborkowicz2557
@marcinborkowicz2557 3 года назад
Simple, informative and helpful 💪👍 Thanks a lot for this tutorial!
@VincentLabStudio
@VincentLabStudio 3 года назад
Glad it was helpful!
@boralugoda.
@boralugoda. 2 года назад
Thank you so much!
@VincentLabStudio
@VincentLabStudio 2 года назад
Glad it helped!
@siddharth_pawar8049
@siddharth_pawar8049 2 года назад
How to add heading in this excel which function to use
@VishalKumar-yg8nh
@VishalKumar-yg8nh 2 года назад
Thanks, this help me
@VincentLabStudio
@VincentLabStudio 2 года назад
Happy to help
@ajithmoni1712
@ajithmoni1712 2 года назад
Thank you.
@VincentLabStudio
@VincentLabStudio 2 года назад
Welcome!
@tonypascoal998
@tonypascoal998 3 года назад
Hy mr Vincent i love you're tutorials.. can you make a video explaining how to display pdf on mobiles with php or js.. without downloading. . Thank you a lot
@node_JS
@node_JS Год назад
Clear
@bookofmystery9670
@bookofmystery9670 Год назад
Man I need your help !! … I’ll forever grateful. there’s a empty excel sheet, in that certain column have full of drop-down cell. It’s empty now. Now I have a JSON data to fill the excel sheet . Now how do I fill the excel sheet with json data. Like how do I fill the drop-down cell with dynamic data from the json ?? . The json data looks like this - array of objects, and each objects has one key called dropdown. That dropdown value is array of string. Please help me .what to do ??
@user-ip6cb5qw4v
@user-ip6cb5qw4v 2 года назад
I guess I can change the data by change Json witch is already in excel file?
@Arko_3
@Arko_3 10 месяцев назад
how to import the dependencies? someone please answer, thankss
@Kevin-pn9ri
@Kevin-pn9ri Год назад
Is there any way to keep the file open while it is being modified?
@rafaelcarvalho2918
@rafaelcarvalho2918 Год назад
how to create dropdown ?
@nickscatajoi1896
@nickscatajoi1896 2 года назад
How to get the sheetname?
@achrafbouchiba3957
@achrafbouchiba3957 3 года назад
Hello, How to add style to header xlsx ? thanks ;)
@julistafita8022
@julistafita8022 3 года назад
Thanks
@communicatinginforminghelp4244
@communicatinginforminghelp4244 2 года назад
Hi, Can we use this to convert xls format file to xlsx?
@sharadruthib6134
@sharadruthib6134 3 года назад
can we make styling in this sheet. Something like a heading for the whole sheet
@VincentLabStudio
@VincentLabStudio 3 года назад
I don't know if it's possible, but I found a few different methods which might work. I have not tested them but I will give you the links here: www.npmjs.com/package/sheetjs-style www.npmjs.com/package/sheetjs-style-v2 github.com/ShanaMaid/sheetjs There's also a pro version of this Library which I think can do it: sheetjs.com/pro I just found this on their documentation: "This is the community version. We also offer a pro version with performance enhancements, additional features like styling, and dedicated support" But I think the libraries I have linked above are a free version of their styling feature.
@tarunt2949
@tarunt2949 2 года назад
can provide validations for an specific xl file before going to upload in react js
@VincentLabStudio
@VincentLabStudio 2 года назад
Sorry I don't know any react.
@hammadmusakhel5102
@hammadmusakhel5102 3 года назад
why is the date in that format? can we change that? I wanted to make charts and as such with dates being the independent variable and the stock prices as the dependent variables. Pls help
@VincentLabStudio
@VincentLabStudio 3 года назад
That's a good question. I assume you can. But I'm not sure. Here is what I found on stack overflow: stackoverflow.com/questions/53163552/format-date-with-sheetjs
@VietLedeptrai
@VietLedeptrai 3 года назад
Hello, thank you for your video. I have a question: - If I have an "id". I wanna del all the row that has the Id. How can I do it?
@VietLedeptrai
@VietLedeptrai 3 года назад
For example, I want to delete a row with Id value = 2587. Thanks
@VincentLabStudio
@VincentLabStudio 3 года назад
@@VietLedeptrai Try the code below. // Import dependencies const fs = require("fs"); const XLSX = require("xlsx"); const jsontoxml = require("jsontoxml"); // Read the file into memory // const workbook = XLSX.read(fs.readFileSync("file-example.xlsx")); const workbook = XLSX.readFile("file-example.xlsx"); // Convert the XLSX to JSON let worksheets = {}; for (const sheetName of workbook.SheetNames) { worksheets[sheetName] = XLSX.utils.sheet_to_json(workbook.Sheets[sheetName]); } // Modify the XLSX worksheets.Sheet1 = worksheets.Sheet1.filter(function(item) { return item.Id !== 2587; }); // Create a new XLSX file const newBook = XLSX.utils.book_new(); const newSheet = XLSX.utils.json_to_sheet(worksheets.Sheet1); XLSX.utils.book_append_sheet(newBook, newSheet, "Sheet1"); XLSX.writeFile(newBook,"new-book.xlsx");
2 года назад
Excellent video. But how I delete a columns?
@VincentLabStudio
@VincentLabStudio 2 года назад
Try the code below. // Import dependencies const fs = require("fs"); const XLSX = require("xlsx"); const jsontoxml = require("jsontoxml"); // Read the file into memory // const workbook = XLSX.read(fs.readFileSync("file-example.xlsx")); const workbook = XLSX.readFile("file-example.xlsx"); // Convert the XLSX to JSON let worksheets = {}; for (const sheetName of workbook.SheetNames) { worksheets[sheetName] = XLSX.utils.sheet_to_json(workbook.Sheets[sheetName]); } // Modify the XLSX worksheets.Sheet1 = worksheets.Sheet1.filter(function(item) { return item.Id !== 2587; }); // Create a new XLSX file const newBook = XLSX.utils.book_new(); const newSheet = XLSX.utils.json_to_sheet(worksheets.Sheet1); XLSX.utils.book_append_sheet(newBook, newSheet, "Sheet1"); XLSX.writeFile(newBook,"new-book.xlsx");
@nandhakumargp5250
@nandhakumargp5250 2 года назад
hey how to make individual json files for each sheet in a xlsx file
@VincentLabStudio
@VincentLabStudio 2 года назад
Try something like this: // Import dependencies const fs = require("fs"); const XLSX = require("xlsx"); // Read the file into memory const workbook = XLSX.readFile("file-example.xlsx"); // Convert the XLSX to JSON for (const sheetName of workbook.SheetNames) { fs.writeFileSync(`${sheetName}.json`, JSON.stringify(XLSX.utils.sheet_to_json(workbook.Sheets[sheetName]))); }
@nandhakumargp5250
@nandhakumargp5250 2 года назад
@@VincentLabStudio this one worked like a charm, can we filter the empty cells too in this package? i didn't find anything in package docs
@sudhansusekharpanda6510
@sudhansusekharpanda6510 3 года назад
It was a really nice one. But I need to only write to the xls file? can you please share the code for only writing to the excel sheet? I tried with your code but it didnt work for me.
@sudhansusekharpanda6510
@sudhansusekharpanda6510 3 года назад
Actually I have a requirement to only update the existing sheet i.e i need a method which ll simply write to the excel file.. to writing the excel file i need to pass some parameters like sheetname, column names to be filled up. can you please help me in this regard?
@bookofmystery9670
@bookofmystery9670 Год назад
@@sudhansusekharpanda6510 exact same task is given to me rn. Would be grateful if you could share how you did it.
@rajat420420
@rajat420420 2 года назад
How to delete worksheet?
@VincentLabStudio
@VincentLabStudio 2 года назад
// Import dependencies const XLSX = require("xlsx"); // Read the file into memory const workbook = XLSX.readFile("file-example.xlsx"); // Create a new XLSX file const newBook = XLSX.utils.book_new(); for (const sheetName of workbook.SheetNames) { // And here you add everything except the one you wanted to delete const newSheet = XLSX.utils.json_to_sheet(XLSX.utils.sheet_to_json(workbook.Sheets[sheetName])); XLSX.utils.book_append_sheet(newBook, newSheet, sheetName); } XLSX.writeFile(newBook, "new-book.xlsx");
@rajat420420
@rajat420420 2 года назад
@@VincentLabStudio thanks for this...but don't we have any function to delete it directly
@VincentLabStudio
@VincentLabStudio 2 года назад
​@@rajat420420 Unfortunately not
@OdiaMadBiker
@OdiaMadBiker 2 года назад
How to add cell styles in xlsx??
@VincentLabStudio
@VincentLabStudio 2 года назад
I don't know if it's possible, but I found a few different methods which might work. I have not tested them but I will give you the links here: www.npmjs.com/package/sheetjs-style www.npmjs.com/package/sheetjs-style-v2 github.com/ShanaMaid/sheetjs There's also a pro version of this Library which I think can do it: sheetjs.com/pro I just found this on their documentation: "This is the community version. We also offer a pro version with performance enhancements, additional features like styling, and dedicated support" But I think the libraries I have linked above are a free version of their styling feature.
@alexisdrawing
@alexisdrawing 2 года назад
Hello, the video is very helpful, but now I'm currently working on a web app and I want the user to be able to print the file but I don't know how to do this with xlsx. If someone has an idea about it, I would be grateful to hear it :)
@codersskill
@codersskill Год назад
ru-vid.com/show-UCbmwl3iMyHmjgcQzbgmgFGA
@ashishjha9154
@ashishjha9154 2 года назад
How to deal with dates value please comment
@VincentLabStudio
@VincentLabStudio 2 года назад
Here is what I found on stack overflow: stackoverflow.com/questions/53163552/format-date-with-sheetjs
@ashishjha9154
@ashishjha9154 2 года назад
@@VincentLabStudio raw false give value in ddmmyy but required ddmmyyyy
@abdelrhmanshokr7546
@abdelrhmanshokr7546 3 года назад
That was a pretty good tutorial I followed you step by step and it worked but now if I need to create a chart and push it to a work sheet is this possible ? whether it's using this package or any other one ? can anyone please help me ?
@VincentLabStudio
@VincentLabStudio 3 года назад
Maybe this is helpful. Chartsheet Object Chartsheets are represented as standard sheets. They are distinguished with the !type property set to "chart". The underlying data and !ref refer to the cached data in the chartsheet. The first row of the chartsheet is the underlying header. Source: www.npmjs.com/package/xlsx or docs.sheetjs.com/ I haven't tested it, but this might be what you're looking for. www.npmjs.com/package/xlsx-chart
@abdelrhmanshokr7546
@abdelrhmanshokr7546 3 года назад
@@VincentLabStudio OK I'll give it a shot amd respond if it worked as I need, anyways thanks a lot for responding
@abdelrhmanshokr7546
@abdelrhmanshokr7546 3 года назад
@@VincentLabStudio yes it worked thanks a lot for your help I really appreciate it it has a slight issue that it only creates one chart if you tried to create another one it overwrites what's in the file and creates the single latest chart I'm still trying to make it work.
@MiguelAngel-yy5hp
@MiguelAngel-yy5hp 3 года назад
how do I do this on the client-side ?
@VincentLabStudio
@VincentLabStudio 3 года назад
I don't know if that would be possible. My recommendation would be to keep back-end functionality on the back end and then exchange information between the back-end and front-end, using an API. And if you want to upload a file from the front-end to the back-end, then you can follow the video linked down below. And the only part you would need to change is the way it handles the file once it's uploaded to the back-end. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-KP_8gN8kh4Y.html
@edward_7_3_9
@edward_7_3_9 2 года назад
do you know how to style it ?
@VincentLabStudio
@VincentLabStudio 2 года назад
I don't know if it's possible, but I found a few different methods which might work. I have not tested them but I will give you the links here: www.npmjs.com/package/sheetjs-style www.npmjs.com/package/sheetjs-style-v2 github.com/ShanaMaid/sheetjs There's also a pro version of this Library which I think can do it: sheetjs.com/pro I just found this on their documentation: "This is the community version. We also offer a pro version with performance enhancements, additional features like styling, and dedicated support" But I think the libraries I have linked above are a free version of their styling feature.
@edward_7_3_9
@edward_7_3_9 2 года назад
@@VincentLabStudio thank for your help
@hammadmusakhel5102
@hammadmusakhel5102 3 года назад
I also wanted to ask that why are you working on a js file? why not show it by working on a VueJs component?
@VincentLabStudio
@VincentLabStudio 3 года назад
Because I like keeping back-end stuff in the back-end, and front-end stuff in the front-end.
@EmanuelRusu
@EmanuelRusu Месяц назад
Be blessed by Lord Jesus Christ!
Далее
1.4: JSON - Working with Data and APIs in JavaScript
16:22
#9 - Nodejs - Convert Excel to JSON | JSON to Excel
18:51
Whoa
01:00
Просмотров 11 млн
Cristiano ronaldo VS Tibo Inshape ! 😱😱
00:20
SPONGEBOB POWER-UPS IN BRAWL STARS!!!
08:35
Просмотров 16 млн
Я ДОСТРОИЛ ЗАВОД - Satisfactory
19:13
Просмотров 150 тыс.
Next.js Reports tutorial with Microsoft Excel
18:19
Просмотров 14 тыс.
Upload and View Excel Files In React
10:37
Просмотров 22 тыс.
JavaScript FileReader
15:08
Просмотров 138 тыс.
Whoa
01:00
Просмотров 11 млн