How to run macro that removes xml tags from csv file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • johanpalmaer
    New Member
    • Feb 2014
    • 2

    How to run macro that removes xml tags from csv file

    Why doesn't this query works when trying as OpenQuery in a macro:
    UPDATE All_files_, filter1 SET All_files_.Fiel d1 = Replace([All_files_].[Field1],[filter1].[Tag],"")
    WHERE (((All_files_.F ield1) Like "*" & [filter1].[Tag] & "*"));

    The table All_files_ contains of a column Field1 which contains tags that I want to filtering/remove. I've defined all these and added them into a separate table filter1 and the column Tag.

    The query works perfectly well when running it manually.
    But when then trying to get it work through a macro, the query only success to remove some tags while others remains. The ones which the macro doesn't success to remove are: <> and </>

    As mentioned, when running the query manually he removes these as well. So it's only when running the query through the macro it fails.

    How to make the macro successfully execute the query through the macro and remove all the tags as I wish.
  • johanpalmaer
    New Member
    • Feb 2014
    • 2

    #2
    I solved it. As is I just have to run the query twice.
    Another method, and perhaps better (depending on) is to change the tags in the filter-table. I will try this other method as well. So, it seem like it was no wrong with the macro...rather the query/filter.

    Comment

    Working...