Results 1 to 4 of 4
  1. #1
    Access_Novice is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2013
    Posts
    265

    Can Access remove nonprinting characters from imported data?

    I copy some information from a website and then paste/values into Excel. I noticed that some non-printing characters are copied to. Suppose I were to import this Excel spreadsheet into an Access table. Now I need to clean up/remove those non-printing characters. What is the best way to do this in Access?



    I suppose I could set up a calculated column with =SUBSTITUTE([InvHours],char(160),"") as the formula, where InvHours is the field name containing the non-printing characters. But if I did this, then I would still retain the original field with the non-printing characters which would increase the size of the database. I don't think I could delete it because then the calculated column wouldn't work. So I would rather not pursue this option if possible.

    Would it be possible to somehow run a macro that could automatically be triggered as soon as data is imported, and that macro would clip out the non-printing characters without having to copy anything to blank columns?

    Or does Access have some built-in feature that could do this?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,913
    You could try an UPDATE sql action to modify the imported data. This could be part of the code that runs the import.

    REPLACE is the correct function in Access. In Access use Chr instead of Char.

    What is the non-printing character? If it's not CR or LF, what is it?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Access_Novice is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2013
    Posts
    265
    the non printing character is char(160).

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,913
    I know the code is 160, wondered what it represents. I found 160 in ANSI character set table. It is a non-breaking space. I don't know if Access can recognize this character because AFAIK there is no way to create it in Access. If Access can't recognize it then it can't find it to replace it.

    The character is showing in imported data as some sort of symbol?

    Should be able to exclude the fields from the import.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 12
    Last Post: 03-03-2013, 07:13 PM
  2. Replies: 5
    Last Post: 06-28-2012, 10:49 AM
  3. Replies: 3
    Last Post: 04-20-2012, 04:33 PM
  4. Replies: 5
    Last Post: 03-10-2011, 02:19 PM
  5. Linking Access Table with already imported External Data (Excel)
    By izzarshah in forum Import/Export Data
    Replies: 1
    Last Post: 07-29-2010, 09:40 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums