Menu

Find/Replace from file

2009-06-19
2012-11-14
  • Lucas Hutmacher

    Lucas Hutmacher - 2009-06-19

    Any thoughts on how to do a massive find/replace?

    Basically i've got a huge xml document & a list of about 100 find/replace stings to apply to the document.  unfortunately, it needs to be done once every few days to recreate a database schema & i just cant find any decent way to massively find & replace stuff.  I use Notepad ++ for all my other text 'needs' and figured someone here may have seen this issue before.

    Any thoughts?  here's an example

    find:
    <field name="ABSOLUTEDISTANCE" aliasName="AbsoluteDistance" esriFieldType="3" length="8" precision="0" required="False" scale="0" domainFixed="False" editable="True" isNullable="True" modelName="AbsoluteDistance"/>

    replace with:
    <field name="ABSOLUTEDISTANCE" aliasName="AbsoluteDistance" esriFieldType="3" length="8" precision="15" required="False" scale="2" domainFixed="False" editable="True" isNullable="True" modelName="AbsoluteDistance"/>

     
    • Adam

      Adam - 2009-06-19

      You might want to look into a scripting language like perl or python.  Or maybe use something like awk/sed if you have access to a linux box.

       
      • cchris

        cchris - 2009-06-19

        sed is in the GnuWinUtil32 port collection. awk was also ported as gawk.exe, and there is an awk Notepad++ ANSI plugin - not sure it is being maintained any longer though.

        CChris