Copy link to clipboard
Copied
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]);
}
Copy link to clipboard
Copied
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]);
}
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Okay I got it....
Thank you very much....
Find more inspiration, events, and resources on the new Adobe Community
Explore Now