1

I need to find the longest string of ALL cells in a table. Unfortunately, the table can have varying number of fields each time. This need to be a generic function. Any leads please?

  • 3
    What software do you have available? This is doable with python scripts... – Erica Aug 26 '14 at 20:59
  • Are there only text and numeric fields? If you have BLOBs, like geometry, you need to specify the criteria for the BLOB's lenght – Matej Aug 26 '14 at 21:30
  • Thanks. I posted my question on another forum with more specifics: geonet.esri.com/message/400009#400009 – Aleksandr Zhuk Aug 26 '14 at 22:20
  • Please tell us what a "cell" is and what constitutes a "string" of them. (One can imagine quite a few reasonable definitions in this context, so some clarification is needed.) – whuber Aug 26 '14 at 22:43
  • With respect, it's not very considerate to ask us to go read another forum to get details on your problem. Not only is it more difficult to examine the Question, but if the Esri forums ever go offline or change their URLs around, the information is lost and anyone who's got a similar question in future can't follow up. Can you please bring your information into this forum (if you still want an answer from here, too)? – Erica Aug 26 '14 at 23:42
2

pseudo code for the function is this:

 longestString = ""
 for each row in rows
   for each field in fields
     if length (current cell value) > length (longestString) then
        longestString = current cell value

How you code it depends on what software you are using.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.