Copiar vínculo al Portapapeles
Copiado
Hello everyone,
Is it possible to read the data from an 'Exel' database file and create an array in .jsx file using the information?
Thanks in advance
You can save your Excel sheet to a CSV file and this can be read into the jsx EG:
var csvFile = File.openDialog("Open Comma-delimited File","comma-delimited(*.csv):*.csv;");
csvFile.open('r') ;
var csvString = csvFile.read();
csvFile.close();
csvString = csvString.split('\n');
for(var s = 0;s<csvString.length;s++){
var lineData = csvString.split(",");
//Process each line of data.
alert(lineData[0]);
}
Copiar vínculo al Portapapeles
Copiado
You can save your Excel sheet to a CSV file and this can be read into the jsx EG:
var csvFile = File.openDialog("Open Comma-delimited File","comma-delimited(*.csv):*.csv;");
csvFile.open('r') ;
var csvString = csvFile.read();
csvFile.close();
csvString = csvString.split('\n');
for(var s = 0;s<csvString.length;s++){
var lineData = csvString.split(",");
//Process each line of data.
alert(lineData[0]);
}
Copiar vínculo al Portapapeles
Copiado
If you are on Windows you can have your javascript create a vbs script that can either create the csv file on demand or extract only the needed data. You could also use the excel ADODB driver to query the spreadsheet using sql.
Unless the sheet changes often and you need to make sure that the cvs file is always curent I would use Paul's suggestion.
Copiar vínculo al Portapapeles
Copiado
Okay I got it....
Thank you very much....
Encuentra más inspiración, eventos y recursos en la nueva comunidad de Adobe
Explorar ahora