Hello, Is there a way to go a batch find and replace for multiple words using a dxl script? I need to replace every reference term with itself just in all caps ( ie. cat --> CAT) in every formal module. Is it possible to create a DXL script that could automate this? Would I be able to create a script with every term and its replacement and then run the script on each module? Thanks! cjjohnson - Tue Sep 23 16:00:56 EDT 2014 | ||||||||||||
Re: DXL Script for a batch find and replace Hi > I need to replace every reference term with itself just in all caps ( ie. cat --> CAT) in every formal module. Is it possible to create a DXL script that could automate this? Yes, it takes a time of about 1 Week or two and I think it is impossible to post such a script, because it needs some individual finetuing. For example, if you use a regular expression like "^(.*)([A-Z][A-Z][A-Z]*)(.*)$" you may find all uppercase words with more than three characters. If you catalog this words you will find a log of words which shall get a different reaction. So:
So you do not ask for a skript. You are asking for someone who does your job. > Would I be able to create a script with every term and its replacement and then run the script on each module? Yes it would be possible. Best regards Wolfgang | ||||||||||||
Re: DXL Script for a batch find and replace Wolfgang Uhr - Wed Sep 24 04:05:06 EDT 2014 Hi > I need to replace every reference term with itself just in all caps ( ie. cat --> CAT) in every formal module. Is it possible to create a DXL script that could automate this? Yes, it takes a time of about 1 Week or two and I think it is impossible to post such a script, because it needs some individual finetuing. For example, if you use a regular expression like "^(.*)([A-Z][A-Z][A-Z]*)(.*)$" you may find all uppercase words with more than three characters. If you catalog this words you will find a log of words which shall get a different reaction. So:
So you do not ask for a skript. You are asking for someone who does your job. > Would I be able to create a script with every term and its replacement and then run the script on each module? Yes it would be possible. Best regards Wolfgang Thanks. I was inquiring to seeing if it was even feasible. I was considering creating a spreadsheet with all the terms, one column with the terms and another with the all caps I'd like to replace them with (to avoid hard coding the terms in dxl) and then calling the file in dxl. Possibly turning those into two separate arrays and stepping through the first to search and then replace with the all caps word and having the array position determine which word to replace with. i.e.
repeat process at termArray[1] = 'dog' and capArray[1] = 'DOG' ... and so on ... I know it is possible to import an excel file and create attributes, but is it possible to turn a column in excel into an array? Possibly create some temp buffers and new arrays to step through and perform the searches and replace?
Thanks!
| ||||||||||||
Re: DXL Script for a batch find and replace I develop this sort of script in this (inside out) order:
In any event, this is extemely difficult:
I'm thinking you can build a Reqexp like this:
That was pretty painful for me also! I have to build things this way since for some reason I cannot visualize more than 7 characters at a time. Anyway, maybe we can read the File:
Now when we want to match something
There surely must be a "Buffer" solution to the above. I think we have a problem with strings containing EOLs. Yup, difficult. -Louie
| ||||||||||||