10 Replies Latest reply on Sep 21, 2015 9:43 AM by George_Johnson

    Need help understanding how to use importTextData

    gwjohnson3 Level 1

      I'm trying to write a script using importTextData and I'm having trouble getting the text file to load properly using Acrobat 9 Pro.  At this point I'm not even worrying about the overall functionality of the script.  I'm just trying to nail down this one piece.

       

      When I run this.importTextData(); in the Acrobat java console, I'm prompted to choose my text file and then the row.  It then returns a value of 3, which is an "invalid row" error.

       

      My text file is as simple as they come.  It contains the following info:

       

      test

      1

       

      I've seen references to a more complex naming convention for the column identifier.  Is that my problem?

       

      My other question is once I finally am able to load the text file, how to I reference the data within?  Does the data get loaded into an array?  Can I assign the loaded data to a variable like this:

       

      var x = this.importTextData();

       

      and then reference the various cells using x[0], x[1], x[2], etc.?  Or do I have to use this.getField?

       

      Sorry if these are silly questions.  My understanding of all of this is very basic.  Thanks.