Да, можно делать то, что вы хотите.
Если вы используете nodejs, вы можете установить этот пакет https://www.npmjs.com/package/xlsx
Вот пример кода того, как вы можете читать значения
'use strict'
const XLSX = require('xlsx');
const workbook = XLSX.readFile('./test.xlsx');
var stream = XLSX.stream.to_json(workbook, {raw:true});
const workSheet = workbook.Sheets.Sheet1;
console.log(workSheet["!ref"]);
//With this function you can see the range of your sheet that had data
//You can create a function to parse this information
//and obtain the range of cell where you want to obtain the values
const valuesRange = ['A1', 'B1', 'C1', 'D1'];
let desiredCell = [];
valuesRange.forEach(cell => desiredCell.push(workSheet[cell]));
const desiredValues = (desiredCell ? desiredCell.map(cell => cell.w) : undefined);
console.log(desiredValues);
// This will return [ '1-Jan-19', '2-Jan-19', '3-Jan-19' ]
//Know you can do whatever you want with this values
// example a parse function to convert to 01/01/2019 and write to new file
Если вы можете использовать электронные таблицы Google, я рекомендую это сделать.
Функции записи и чтения очень просты.
Вам нужно будет установить https://www.npmjs.com/package/util и https://www.npmjs.com/package/googleapis
const { google } = require('googleapis');
const util = require('util');
const SCOPES = ['https://www.googleapis.com/auth/spreadsheets'];
module.exports = class SpreadSheetService {
constructor(spreadsheetId) {
this.spreadsheetId = spreadsheetId;
this.jwt = new google.auth.JWT(<UserEmail>, null, <Base64Key>, SCOPES);
this.sheets = google.sheets({ version: 'v4', auth: this.jwt });
this.readSpreadSheet = util.promisify(this.sheets.spreadsheets.values.get);
this.updateSpreadSheet = util.promisify(this.sheets.spreadsheets.values.update);
}
async read(sheet, cell) {
return this.readSpreadSheet({
spreadsheetId: this.spreadsheetId,
range: `${sheet}!${cell}`,
valueRenderOption: 'UNFORMATTED_VALUE'
});
}
async write(sheet, cell, value) {
return this.updateSpreadSheet({
spreadsheetId: this.spreadsheetId,
valueInputOption: 'USER_ENTERED',
range: `${sheet}!${cell}`,
resource: { values: [[value]] }
});
}
};