Extract Table from String

Hi ,

Is there any possible way to extract table structure from single line string , like I am using the getpdftext to get the text in single like string , but it has table structure inside it, is there any way to extract the table from it?

Thanks

Bihitak

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Do you have control over the format of the string?  If so, you could add delimiters to the string and be able to parse it with simple expression.  You'd want to add delimiters like semicolon (;) or pipe (|) etc., something that's not going to appear in the text of inside a cell and confuse the thing.  Or if it already has those kind of delimiters, you're already golden.

    After that, you can use the split() function to split out the string into a list of string.  Provided that you keep the format consistently, each one of your arrays of strings should have the same length.  You can then index the first item, the second item, and so on, plugging each into a CDT.  Then you can do whatever you want to it as CDT and save the CDT to the database.

    Or you could use Record Type constructor to convert list of string into Record Type, then do whatever you want to the Record, then save it to the DB.

Reply
  • 0
    Certified Lead Developer

    Do you have control over the format of the string?  If so, you could add delimiters to the string and be able to parse it with simple expression.  You'd want to add delimiters like semicolon (;) or pipe (|) etc., something that's not going to appear in the text of inside a cell and confuse the thing.  Or if it already has those kind of delimiters, you're already golden.

    After that, you can use the split() function to split out the string into a list of string.  Provided that you keep the format consistently, each one of your arrays of strings should have the same length.  You can then index the first item, the second item, and so on, plugging each into a CDT.  Then you can do whatever you want to it as CDT and save the CDT to the database.

    Or you could use Record Type constructor to convert list of string into Record Type, then do whatever you want to the Record, then save it to the DB.

Children
No Data