Find long strings

E

EllenM

Hello,
I have a table in a web page that is too wide for the screen. It's due to a
long string that prevents wrapping at at reasonable place. How may I find
the long strings in a cell? Let's start with strings of 25 characters?

Thanks in advance,
Ellen
 
J

Jeff Boyce

Ellen

It isn't clear if you are working with Microsoft Access (the topic of this
newsgroup). Access doesn't have "cells".

More info, please...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
E

EllenM

Hi Jeff,
I have a table that has some large strings that causes columns to be very
wide, too wide to fit on the screen when this table is saved in html. It's
probably long urls that I'm looking for.

Thanks,
Ellen
 
J

Jeff Boyce

Ellen

If you create a new query against that table and include a new field
something like:

NewField: Len([YourQuestionableField])

you will get the length of the strings in that field. You can sort
<Descending> on that new field to get an idea of how long the longest are.

And if you include other fields in that query, you can see more info about
which ones are longer.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
E

EllenM

Hi Jeff,
I wound up writing a regular expression script to find the urls. I used a
module written by John Nurick, which I got from John Spencer.

SELECT frnot2003.DATE, frnot2003.SUBJECT,
rgxExtract([frnot2003]![SUBJECT],"http://[-\w.]+[/\w+]+\.\w+",0) AS Expr1,

Len(rgxExtract([frnot2003]![SUBJECT],"http://[-\w.]+[/\w+]+\.\w+",0)) AS Expr2
FROM frnot2003
WHERE (((frnot2003.SUBJECT) Like "*http://www*") AND

((Len(rgxExtract([frnot2003]![SUBJECT],"http://[-\w.]+[/\w+]+\.\w+",0)))>20))
ORDER BY frnot2003.DATE;

It's a start. We also have chemical names in our tables which can be very
long. They, however, have lots of parentheses and commas, so they may wrap
fine and not be a problem.

Thanks,
Ellen
 
J

Jeff Boyce

Thanks for posting back your solution.

That way, someone else in the future will be able to find an answer when
they have the same (a similar) question.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top