Results 1 to 10 of 10
  1. #1
    mentose457 is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    8

    Find and replace tabs from data

    Hi everyone! I’ve got a few questions for you access experts out there.



    I have data in column that has tabs in it. Which is a problem because I have to export the data as a tab delimited text file. So my question is how can I find and replace the tabs in a column and replace them with a space?

    BTW, I run Access 2010 on Win 7 64bit.

    Your responses are much appreciated.

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    Use update query to do the replacement:

    update [yourtable] set [fieldname]=replace([fieldname],chr(9)," ")
    where instr(1,[fieldname],chr(9))>0

  3. #3
    mentose457 is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    8
    Quote Originally Posted by weekend00 View Post
    Use update query to do the replacement:

    update [yourtable] set [fieldname]=replace([fieldname],chr(9)," ")
    where instr(1,[fieldname],chr(9))>0
    This it the what the query column looks like now:

    v_products_description_1: [Description] & " " & [Warranty] & " " & Chr(13) & Chr(10) & Chr(13) & Chr(10) & [RestrictedAreas]

    can i use the solution you posted above in this situation?

    Thanks

  4. #4
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    I don't understand what you want. in the first post you said you want to replace all tabs to space, and in the last post you gave me an expression joining some fields.

  5. #5
    mentose457 is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    8
    Quote Originally Posted by weekend00 View Post
    I don't understand what you want. in the first post you said you want to replace all tabs to space, and in the last post you gave me an expression joining some fields.
    Sorry, I should have added that the [Description] column is the one with the tabs that need to be removed.

    So do I have to do a query and replace the tab with a space like in your solution above then do another query with the expression I posted above? Or can i do this:

    v_products_description_1: ([Description] =replace([Description],chr(9), " ") where instr(1,[Description],chr(9))>0) & " " & [Warranty] & " " & Chr(13) & Chr(10) & Chr(13) & Chr(10) & [RestrictedAreas]

  6. #6
    mentose457 is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    8
    Bumpy bump bump.

  7. #7
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    you don't need to update, just use select query:
    v_products_description_1: replace([Description],chr(9), " ") & " " & [Warranty] & " " & Chr(13) & Chr(10) & Chr(13) & Chr(10) & [RestrictedAreas]

  8. #8
    mentose457 is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    8
    Quote Originally Posted by weekend00 View Post
    you don't need to update, just use select query:
    v_products_description_1: replace([Description],chr(9), " ") & " " & [Warranty] & " " & Chr(13) & Chr(10) & Chr(13) & Chr(10) & [RestrictedAreas]
    Thanks for your help! Ill give it a try.

  9. #9
    mentose457 is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Dec 2010
    Posts
    8
    Worked great! Thanks again for your help.

  10. #10
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    you are welcome.

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

Similar Threads

  1. Find and Replace query from a 2nd table
    By elightbox in forum Queries
    Replies: 1
    Last Post: 09-17-2010, 05:37 PM
  2. Dumb question about find/replace
    By Perplexed in forum Access
    Replies: 11
    Last Post: 08-04-2010, 09:53 AM
  3. Find and Replace Query
    By randolphoralph in forum Queries
    Replies: 4
    Last Post: 03-17-2010, 07:25 AM
  4. Applying a find/replace function
    By Arr in forum Programming
    Replies: 2
    Last Post: 10-12-2009, 12:28 PM
  5. Find data, load data, and save as a new record
    By hawzmolly in forum Access
    Replies: 0
    Last Post: 10-05-2008, 03:18 PM

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