View Single Post
  #4  
Old April 27th, 2010, 05:08 PM posted to microsoft.public.access
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Finding unprintable characters in data

On Tue, 27 Apr 2010 08:20:02 -0700, Nich
wrote:

I imported data which contained cr/lf or char(13). How do I find these
characters and strip them out?


That's curious: I just answered an almost identical question from "Dave".
Here's what I told him, which you should be able to adapt:

You'll need to find out what it is. My guess is that it's a linefeed Chr(10) -
it wouldn't hurt to make a backup of your database just in case, and run a
query

SELECT memofield, InStr([memofield], Chr(10))
FROM tablename
WHERE memofield LIKE "*" & Chr(10) & "*"

to see if it shows the records with the box and the position of the linefeed.
Count characters and see if it matches.

You could then run an Update query updating the memo field:

UPDATE tablename
SET memofield = Replace([memofield], Chr(10), "")

Note that if the field has legitimate carriage return-linefeed characters this
will do more harm than good!

--

John W. Vinson [MVP]