Exporting tables individually

Question

The page contains 3 tables. Is there a way to export each table into a separate CSV file?

Answer

There are no CSV export settings that allow saving tables from a single document to separate CSV files. There is, however, a workaround, which could be applied.

  1. Analyze the document by calling the FRDocument::Analyze method
  2. Create the ImageModification object of the Image object (FRPage::ImageDocument::Image);
  3. Make a cycle for every Layout Block in the FRPage of the FRDocument.
  4. Inside this cycle, create an if statement with the type of the Layout Block. If the type of the Layout Block is BT_Table value (FRPage::ILayoutBlocks::IBlock::Type = BT_Table), complete steps 4.1-4.4.
    1. Get the Region of this table Block (myRegion = ILayoutBlocks::IBlock::Region);
    2. Call the ImageModification→ClearClipRegions() method;
    3. Call the AddClipRegion method of the ImageModification object with the Region argument from step 4.2: ImageModification→AddClipRegion(myRegion);
    4. Save the Image with the clipped region (table block) as a new file: Image→WriteToFile(newFileName, filFormat, ImageModification, 0);
  5. After step 4 there will be several documents containing only one table each. This way these several documents can opened analyzed, recognized, and exported into a separate CSV file.

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.

Recently viewed