• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Retrieving data from Excel file

New Here ,
Feb 11, 2014 Feb 11, 2014

Copy link to clipboard

Copied

Hello,

I have an fm file with a list of parameters. I want to read them one by one, and plant their description in the fm file under the name of the parameter. The description is in an excel file. The B column of the excel file contains the name of the parameter, and the C column contains the description I want to fetch. Attached an example:

Return description in column C

Where column A = App_GlobalResources\ConfigSetsResources

AND column B = [name of parameter]

How do I do this?

TOPICS
Scripting

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 11, 2014 Feb 11, 2014

Copy link to clipboard

Copied

Hi,

I have been using an Excel file to handle the administration of a repository management system, with hundreds of entries going into the Excel sheet and being read from the sheet by management scripts. I know what it does to the performance of your application.

My word of advice on this: even though it is technically possible to access an Excel file directly to retrieve the data, I would steer clear of that option. The problem is that you create an enormous overhead for each single read operation on a cell in Excel (an ActiveX or other object must be created that can do almost anything you would ever want to do, including frying some eggs for breakfast).

The easy way of doing this: save your Excel sheet as CSV file (note that Excel really creates 'SSV' - semicolon separated variables - and does not tell you about this), then make your script read the file line by line as text and use the JavaScript split method to retrieve the separate cells from the original Excel sheet. Works fine, and fast. Several customers for my tailor-made CMS are using this method hundreds of times every day (without ever noticing it).

Good luck

Jang

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 11, 2014 Feb 11, 2014

Copy link to clipboard

Copied

I don't think you can use ActiveX (or COM) objects with FrameMaker's ExtendScript. If so, I would like to know how. I agree with Jang, though. It is pretty easy to parse through a CSV file with ExtendScript.

FrameScript is much better with ActiveX objects. I have a bunch of FrameScript scripts that read and write to Excel spreadsheets.

Rick

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 11, 2014 Feb 11, 2014

Copy link to clipboard

Copied

Hi Rick,

you are right you don't have such features as ActiveX or COM-Integration with ExtendScript. If you want to have this, you have to use FDK or FrameScript.

But I found a possibility on how you can get such a connection via external objects. You will find an example here:

C:\Programme\Adobe\Adobe ExtendScript Toolkit CC\SDK\Samples\cpp

I think Russ already implemented such a connect in the past. But I think it's a little bit tricky.

Bye Markus

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 11, 2014 Feb 11, 2014

Copy link to clipboard

Copied

LATEST

If I have to do such things out from excel I work with Excel XML Calculation Tables (2003) format.Then I use XML Objects of ExtendScript. But it get's a little bit tricky due to that multiple namespaces in the Excel XML format.

In most cases CSV would be the best and easiest way.

Hope this helps

Markus

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines