Search and Replace DQXI Transform for Status Codes
I've been tasked with creating a Search and Replace transform to convert DPV status codes into the textual equivalents. For example, a status code of "S20000" would convert to "A different city was assigned."
There are over 200 possible combinations, so I'd like to know if someone else has done this, and would be willing to share their code.
You could store all your patterns in a Map. Then iterate over the map inserting the patterns into a regex.
Similar Messages
-
Search and replace in Pages for ipad
Does Pages do this? Or anything else in the app store?
Try this:
Turn on Show Invisibles in the View menu.
Select (highlight) the double para breaks.
Use Command-E (Find using selected text).
Open the Find dialogue box (Command-F) and select Find & Replace.The selected para breaks will be in the Find text entry box, but will not be visible!
Click in the Replace text entry box.
Select (highlight) a single para break.
Go to the Edit menu / Find and select 'Use selection for replace' (it will not show in the Replace entry box).
In the Find & Replace dialogue box, click on the Forward or Back arrows to highlight the selected items (e.g. double para break) where you wish to start replacing in the document.
Use the Replace All / Replace & Find / Replace buttons as per usual.
Not a nice solution, but I hope it gets you going until Apple restores the previous functionality! -
Search and replace a clickbox for a transparent button?
Is it possible to replace all click boxes for transparent buttons in a project?
Why? Because you can style a transparent button. You cannot style (as far as i know) a clickbox.
Ton.LOL, so Transparent Buttons aren't really what you want. Well, technically they may be, but you really don't want an honest to goodness transparent button.
Because you will need to re-create the functionality of the button, I might think it would be simpler to just add either a Rectangle Drawing Object or a Highlight Box and layer it over the top of the Click Boxes. But that's just me.
No, there is no functionality I'm aware of that will magickally transform all Click Boxes to Transparent Buttons. But nothing is stopping folks from requesting it via the Wish Form.
Cheers... Rick
Helpful and Handy Links
Captivate Wish Form/Bug Reporting Form
Adobe Certified Captivate Training
SorcerStone Blog
Captivate eBooks -
Search and Replace in Dreamweaver
Dreamweaver CS3has a nice search and replace tool allowing for search and replacement of very large text strings.
Does anyone know of a good notepad editor that can handle that large of replace text strings.
Seems like most cant handle that much code in terms of search and replace.
thanksIf you're looking for something free/cheap that handles multi-line search and replace in source code, then there's always TextWranger if you're on a Mac:
http://www.barebones.com/products/TextWrangler/
There are plenty of Windows equivalents, but none I've used extensively and could recommend. This one is free:
http://www.htmlkit.com/
...and has a button to expand the find/replace fields for multi-line content.
That being said, they're not really going to do anything DW can't if you're already using DW. -
Xml search and replace for 'Session Variables' in column title view
Hi Experts,
I have around 10 reports where measure column titles are displayed based the session variable.
Below is the syntax I have used in the column title
@{biServer.variables['NQ_SESSION.VariableName']}
Now I would like to replace the above syntax with some static text. To do this, I am trying to use the xml search and replace feature in the catalog manager.
For some reason, catalog manager is unable to find the syntax in the xml file. I have tried using escape character also for the apostrophe by using &apos, but no luck.
Any pointers on how to replace the text?
ThanksUsing Analysis get the xml conversion for @{biServer.variables['NQ_SESSION.VariableName']} from Advanced tab's xml code
use this code to find in catalog manager, if you able to find then go for search and replace option.
I think this should work for you. -
How do I search and replace for invisibles in Pages 5.5.2?
Three related problems all involving search and replace for invisibles.
1. A block of text where all double returns need to become single returns.
2. A block of text where all returns need to be replaced with a single word space.
3. A block of text where all double word spaces to be replaced with a single word space.
Pages 09 could do all three this handily. How can these be done in Pages 5.5.2?
Appreciated.Here are screenshot of my attempts to make reducing double returns to one. First up selection of a double return:
Copy to the clipboard. Do a Command-F. Here's the resulting dialogue:
I paste in the contents of the clipboard:
Note the Search field no longer has an empty slot selected. Something is clearly in there, but no instance of whatever is has been found. Nevertheless, I proceed to set up the Replace field by selecting a single return:
Copy that to the clipboard and paste into the Replace field:
Nothing to search for and therefore nothing to replace. Am now wondering what that little scoop to the right of the eyeglass icon might indicate. Clicking on it reveals this:
Definitely not "a solution that just works." -
Global Search and Replace for Scrambled/Garbled Characters
So I exported a bunch (over 3000) contacts from my Outlook on Windows by using Outlook2Mac, and also tried just using a straight CSV export. But the Chinese characters came out all garbled, and I no longer have the use of that Windows machine anymore.
Here's an example:
Name: ∂¿¨¸™K (May Huang)
Job Title: ±M§·∏g≤z
Dept: ¿Á∑~≥B/ODM∑~∞»≥°
Company: ®Ù•fl∞ͪ⁄
Address:
§≠™—∂m§≠≈v§≠∏Ù15∏π
•x•_ø§
•x∆W
I figure I can slowly piece together most of it by doing lots of global search and replaces -- for instance, "•x∆W" should be "台灣" (Taiwan) -- and changing each characters I know one by one.
Problem is, I can't figure out how to do a find and replace! Can anyone help me out?
Thanks in advance!
PowerBook G4 17 Mac OS X (10.4.5)But for the sake of getting a solution to the
original problem, I wasn't able to export the vCards
from AddressBook and then do what you said. For some
reason, I couldn't open the .vcf file in TextEdit;
kept telling me that the file wasn't encoded in
"Traditional Chinese (Windows, DOS)" format.
You need to use the Open dialogue in TextEdit and open the .vcf in something that it will accept. When you export the stuff from Address book, it indeed is not in Trad Chinese.
I don't have your stuff, so I can't be exactly sure, but it should work something like this. You export everything from Address Book. Use the Open dialogue of TextEdit to open the file, probably as UTF-8. Save as MacRoman. Open again as Trad Chinese (Windows). Save as UTF-8. Reimport. You may need to experiment to find what works right. -
GUI Based tool for search and replace using regular expression
Hi,
I have developed this small tool which can be used for search and replace in multiple files using reqular expressions.
Features:
1. Full regular expression
2. GUI based with Highlighted results
3. Preview for replace available
4. Pure Java based.
5. Its like unix sed and grep
Please visit below site for download/more information :
http://sourceforge.net/projects/regexsearchrepl/
Thanks,
Hitesh ViseriaI agree with you, it cannot compete grep/sed/awk combination. I couldnt find anything even close to grep/sed for windows which will also have a preview and most important, free. That is what made me write this tool. I am trying to
improve its performance and more features like history etc.
Any suggestions on additional features are most welcome. -
Search and replace for Unicode characters
Hello,
I have a function which searches and replaces characters on file. It works with ASCI sharacters, but not when the strings which needs to be replaced contains Unicode ('á', 'ā') etc. The source file is codding
utf8 .
$file = "file.txt"
$SearchReplace = @($file)
#Process files by performing a search and replace
foreach ($file in $SearchReplace)
#Select-Object -Skip 1 |
(Get-Content $file) |
Foreach-object { $_ -replace 'unicode_string' , ';' } |
out-file -encoding Unicode $file
How to get working the search (and replace) function with Unicode characters?
Thanks!No. it does not. I have verified that script does not recognize the diacritic
('á',
'ā') characters when at all the operations with the files I have specified encoding utf-8/Unicode. -
How to search and replace in an xml file using java
Hi all,
I am new to java and Xml Programming.
I have to search and replace a value Suresh with some other name in the below xml file.
Any help of code in java it is of great help,and its very urgent.
I am using java swings for generating two text boxes and a button but i am not able to search in the xml file thru the values that are entered into these text boxes.
Thanks in advance.
**XML File*
<?xml version="1.0" encoding="ISO-8859-1"?>
<student>
<stud_name>Suresh</stud_name>
<stud_age>40</stud_age>
</student>Also i am using SAX Parser in the java program
any help of code or any tutorials for sax parisng is very urgent please help me to resolve this problem
Edited by: Karthik84 on Aug 19, 2008 1:45 AM
Edited by: Karthik84 on Aug 19, 2008 3:15 AMUsing XPath to locate the elements you are after is very easy.
Try something like this:
import java.io.File;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFactory;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
public class BasicXMLReplaceWithDOM4J {
static String inputFile = "C:/student.xml";
static String outputFile = "C:/studentRenamed.xml";
public static void main(String[] args) throws Exception {
// Read xml and build a DOM document
Document doc = DocumentBuilderFactory.newInstance()
.newDocumentBuilder().parse(new InputSource(inputFile));
// Use XPath to find all nodes where student is named 'Suresh'
XPath xpath = XPathFactory.newInstance().newXPath();
NodeList nodes = (NodeList)xpath
.evaluate("//stud_name[text()='Suresh']", doc, XPathConstants.NODESET);
// Rename these nodes
for (int idx = 0; idx < nodes.getLength(); idx++) {
nodes.item(idx).setTextContent("Suresh-Renamed");
// Write the DOM document to the file
Transformer xformer = TransformerFactory.newInstance().newTransformer();
xformer.transform(new DOMSource(doc), new StreamResult(new File(outputFile)));
}- Roy -
HTML character entities problem in saved regex search and replace query
I have a many search and replace regular expression queries (.dwr files) that I have saved. I have a problem specifically with saved queries that contain HTML entities such as "& nbsp ; " or "& shy ;" (spaces added otherwise code doesn't render in browser). For example if I use the following search:
([\d]{3}& shy ;[\d]{3}& shy ;[\d]{4}|[\d]{3}& nbsp ;[\d]{3}& nbsp ;[\d]{4})
(which searches for numbers in the 888-555-1234 or 888 555 1234 formats)
This will work fine if I manually enter it into the search text area. However if I save it to file and reload it, it will no longer work because the ­ and characters are now displayed as " " (space) and "-"(shy) rendering the saved query useless as it's no longer searching for the code. I have some fairly long and complex queries and this is becoming a problem.
Thanks for any help.
I'm currently using Dreaweaver CS4 at home and CS5.5 at work.Thanks for your reply Kenneth, but that is not what I'm trying to accomplish. I'm looking for the HTML entities that exist in the source code which are & shy ; and & nbsp ; (without the spaces). As I mentioned above, if I enter them manually in the search box, I will get the corrrect results. If I save the search and then reload it, the special characters are no longer in HTML and the search is now useless.
Just for example again
In an open document in code view insert a number in the format (without the spaces): 888& nbsp;888& nbsp ;8888
Open a search dialog box and enter (without the spaces): [\d]{3}& nbsp ;[\d]{3}& nbsp ;[\d]{4}
The search will find that entry.
Save search as phone.dwr for example. Then load it and try the search again. It won't work because upon loading the search Dreamweaver replaces the HTML code which was saved with the rendered HTML. So now the search shows up as: [\d]{3} [\d]{3} [\d]{4} which will not find the string with hard coded non-breaking spaces that I'm looking for.
Basically I want to be able to save a search query for reuse. When I load a search query, I want it to be exactly what I saved, not something that DW has rendered (that doesn't work). -
In 8.2, the only thing the project has to let you search for a vi is "Find vi's on disk", which is redundant since I can do that in windows explorer. What I want is a way to search for vi's in my application the way the search and replace function works, except I want it to apply to all vi's in a project instead of just the vi's currently loaded in memory. Do we have this in 8.5?
-Devin
I got 99 problems but 8.6 ain't one.I'll give an example of what I was trying to do yesterday in 8.2. I tried to build a source distribution of a large instrument driver. Since its an instrument driver there is no single top-level vi that contains all vi's - there are different categories of vi's to do different functions on my instrument. When I'm doing the source distribution I have to do it in several stages since 8.2 doesn't do source distributions right - but thats not really what this post is about. Anyway, every time I do the distribution I get an error saying CnvrtArrayIntoBitPattern.vi is password protected (and another engineer wrote it and I don't have the password). So the build fails. Now I don't know the password, I'll find it out later, but I at least want to know where in the hierarchy this vi is even being called. I don't know where it is on disk, I don't know what is calling it, it isn't in the project explicitly, it's a dependency.
If I had a top-level vi that loaded everything, I could just do a search and replace on that vi and find exactly where it is being called in seconds. But since I am in a project and have no idea where to start looking, there is no way I can find this vi. Ideally, in 8.5 there would be a search and replace menu option that searches all vi's in a project to find any calls to this vi. I want to look for all instances of a vi in my project. It sounds like you still can't really do that in 8.5.
What I ended up doing is writing a vi that opens all vi's in a folder hierarchy on disk. I don't know where this vi is, but all vi's in my project are in the same root folder. So I run my program to open every single project vi. Then since I know every single vi is open and loaded simultaneously I used the search and replace function on one of them to find all instances of CnvrtArrayIntoBitPattern.vi. But that is a painstaking process to create a simple search function.
I think NI is maybe misunderstanding how people are actually using a project. Not every vi that is being called is going to be explicitly listed in the project. (Its this same issue that makes source distributions impossible in 8.2 - you can't target dependencies to a support library so every dependency has to be explicitly listed in the project - which is virtually impossible because they are all in different locations and there are hundreds.) Most people have lots of general purpose vi's they use in many different projects, and they are buried down in code so we aren't even sure where they are all being used. The new searches you mention assume you already know where the low-level function is and you are looking for their callers. But sometimes you don't even know where the low level function is. What if its an NI directory function? For example, "resample waveform.vi" is an NI function that changed its defaults in 8.2 which meant we had to find every single place we used it and wire "open-interval?" to a constant instead of depending on the default value. Its in an NI library somewhere and is never listed as a project vi. So when I needed to find every place through every project that I used this vi, I couldn't do it through the project manager because there is no search function. To be practical I add the project-specific vi's to the project, and maybe a couple support directories, but there will always be lots of vi's as dependencies. But every now and then I'm still going to want to search for one of these vi's. So in 8.5 there is there still no way to search for vi's that aren't explicitly listed in the project?
-Devin
I got 99 problems but 8.6 ain't one. -
Search and replace strings in a file while ignoring substrings
Hi:
I have a java program that searches and replaces strings in a file. It makes a new copy of the file, searches for a string in the copy, replaces the string and renames the new copy to the original file, thereafter deleting the copy.
Now searching for "abcd", for eg works fine, but searching for "Topabcd" and replacing it doesnot work because there is a match for "abcd" in a different search scenario. How can I modify the code such that if "abcd" is already searched and replaced then it should not be searched for again or rather search for "abcd" as entire string and not if its a substring of another string.
In the below code output, all instances of "abcd" and the ones of "Topabcd" are replaced by ABCDEFG and TopABCDEF respectively, whereas according to the desired output, "abcd" should be replaced by ABCDEFG and "Topabcd" should be replaced by REPLACEMEFIRST.
try
String find_productstring = "abcd";
String replacement_productstring = "ABCDEFG";
compsXml = new FileReader(compsLoc);
compsConfigFile = new BufferedReader(compsXml);
File compsFile =new File("file.xml");
File compsNewFile =new File("file1.xml");
BufferedWriter out =new BufferedWriter(new FileWriter("file1.xml"));
while ((compsLine = compsConfigFile.readLine()) != null)
new_compsLine =compsLine.replaceFirst(find_productstring, replacement_productstring);
out.write(new_compsLine);
out.write("\n");
out.close();
compsConfigFile.close();
compsFile.delete();
compsNewFile.renameTo(compsFile);
catch (IOException e)
//since "Topabcd" contains "abcd", which is the search above and hence the string "Topabcd" is not replaced correctly
try
String find_producttopstring = "Topabcd";
String replacement_producttopstring = "REPLACEMEFIRST";
compsXml = new FileReader(compsLoc);
compsConfigFile = new BufferedReader(compsXml);
File compsFile =new File("file.xml");
File compsNewFile =new File("file1.xml");
BufferedWriter out =new BufferedWriter(new FileWriter("file1.xml"));
while ((compsLine = compsConfigFile.readLine()) != null)
new_compsLine =compsLine.replaceFirst(find_producttopstring, replacement_producttopstring);
out.write(new_compsLine);
out.write("\n");
out.close();
compsConfigFile.close();
compsFile.delete();
compsNewFile.renameTo(compsFile);
catch (IOException e)
}Thanks a lot!Hi:
I have a java program that searches and replaces
strings in a file. It makes a new copy of the file,
searches for a string in the copy, replaces the
string and renames the new copy to the original file,
thereafter deleting the copy.
Now searching for "abcd", for eg works fine, but
searching for "Topabcd" and replacing it doesnot work
because there is a match for "abcd" in a different
search scenario. How can I modify the code such that
if "abcd" is already searched and replaced then it
should not be searched for again or rather search for
"abcd" as entire string and not if its a substring of
another string.
In the below code output, all instances of "abcd" and
the ones of "Topabcd" are replaced by ABCDEFG and
TopABCDEF respectively, whereas according to the
desired output, "abcd" should be replaced by ABCDEFG
and "Topabcd" should be replaced by REPLACEMEFIRST.
try
String find_productstring = "abcd";
String replacement_productstring = "ABCDEFG";
compsXml = new FileReader(compsLoc);
compsConfigFile = new
BufferedReader(compsXml);
File compsFile =new File("file.xml");
File compsNewFile =new File("file1.xml");
BufferedWriter out =new BufferedWriter(new
FileWriter("file1.xml"));
while ((compsLine =
compsConfigFile.readLine()) != null)
new_compsLine
=compsLine.replaceFirst(find_productstring,
replacement_productstring);
out.write(new_compsLine);
out.write("\n");
out.close();
compsConfigFile.close();
compsFile.delete();
compsNewFile.renameTo(compsFile);
catch (IOException e)
//since "Topabcd" contains "abcd", which is
the search above and hence the string "Topabcd" is
not replaced correctly
try
String find_producttopstring = "Topabcd";
String replacement_producttopstring =
topstring = "REPLACEMEFIRST";
compsXml = new FileReader(compsLoc);
compsConfigFile = new
gFile = new BufferedReader(compsXml);
File compsFile =new File("file.xml");
File compsNewFile =new File("file1.xml");
BufferedWriter out =new BufferedWriter(new
dWriter(new FileWriter("file1.xml"));
while ((compsLine =
compsLine = compsConfigFile.readLine()) != null)
new_compsLine
new_compsLine
=compsLine.replaceFirst(find_producttopstring,
replacement_producttopstring);
out.write(new_compsLine);
out.write("\n");
out.close();
compsConfigFile.close();
compsFile.delete();
compsNewFile.renameTo(compsFile);
catch (IOException e)
Thanks a lot!I tried the matches(...) method but it doesnt seem to work.
while ((compsLine = compsConfigFile.readLine()) != null)
if(compsLine.matches(find_productstring))
System.out.println("Exact match is found for abcd");
new_compsLine =compsLine.replaceFirst(find_productstring, replacement_productstring);
out.write(new_compsLine);
out.write("\n");
else
System.out.println("Exact match is not found for abcd");
out.write(compsLine);
out.write("\n"); -
Bug in Multi-File Search and Replace in RH6?
I'm using the 6.0 trial, and one thing I want to be able to
do is to replace the variables I put in using JavaScript with the
new feature variables in 6.0. So, I went in to multi-file search
and replace, and searched for:
<script
language=JavaScript>document.write(varProduct)</script>
I copied this code directly from a topic, and pasted it into
the Search tool.
I don't even care whether I can successfully copy the code
from my new variable for use as the replacement text; I'd be happy
if the multi-file search would simply find all occurrences of my
original code so I don't miss any during conversion to 6.0.
It keeps coming up as not found, and this concerns me
greatly. Has anyone else experienced this? Is it a known bug? Does
anyone have a workaround?
Thanks!Hi robowriter
I'm assuming you are using the wondrous little applet known
as Multi-File Find and Replace.
Unfortunately, this little beastie is like a cat. It
frequently has a fussy tummy and loves to hork up furballs. Well,
not exactly. Really what it does is fail to properly handle
anything with a line break. So you need a tool that does do this.
Fortunately, one exists! It is called FAR (Find And Replace). Oddly
enough, it was also written by a fellow Microsoft Help MVP named
Rob Chandler. (Rob lives in Australia)
You can download a trial version of FAR from the FAR page.
Click here to visit
the FAR page
Cheers... Rick -
Search and replace string function
Hello, I am using the "search and replace string" function and it does nt seem to work consistently for me. I am using it in a situation where I am taking an array of strings, converting this into a spreadsheet string then deleting all of the commas. Has anyone experienced the same behavior? I have searched through other posts and found other simular faults but none of the fixes worked for this. I can post the code it needed.
Thanks,
AndrewI agree that commas are often not desirable, especially if your software should also work in countries where comma is used as a decimal seperator.
Where are the commas coming from? Does (1) each element of the original array have one (or more), do you (2) use comma as seperator if you convert it to a spreadhseet string?
For (1), you might just strip out the comma for each element right in the loop. For case (2) you would simply use a different separator to begin with, of course.
Btw: you are abusing a WHILE loop as a FOR loop, because you have a fixed number of iterations. Please replace it with a FOR loop. If you use a FOR loop, LabVIEW can manage memory much more efficiently, because it can allocate the entire output array before the loop starts. For While loops, the total number of iterations is not known to the compiler. (Of course a real program would also stop the loop if an error occurs. In this case you would need to stay woth the WHILE loop. )
Do you have a simple example how the raw array elements look like. How many commas are there?
LabVIEW Champion . Do more with less code and in less time .
Maybe you are looking for
-
Hey I'm a novice on computers but i've just done a full system restore on my laptop and put it back to factory spec, obviously i backed up all the data on an external hard-drive but when i have re-installed itunes and gone to import all my old music
-
Hi, I am using ECC6.0 version. When I am clicking the vendor open Invoice (document type RE ) in the vendor ledger (fbl1n) ,following Fields are not coming. the fields are: 1. payment terms 2.base line date 3.discount base Can any one tell why this i
-
Hi I have almost migrated an application from jboss to CE 7.1 sp3 maxdb 32 bit however I am getting the following error on c:out tag of standard jslt. Runtime error in processing of the JSP file [C:\usr\sap\CE1\J00\j2ee\cluster\apps\<....>\
-
An unidentified error has occured? trying to connect with database for forms
I am new to website development and have been using dreamweaver for my website. I am using WAMP server and have all my files on the host. In dreamweaver when i add the database details: connection name : connlogin mySQLserver: localhost username: roo
-
I have iphone4. I tried 2 update some applications when I was in USA, updates installation were not complete. Coming back 2 my country Egypt, I am unable to complete the installation of the update; it is still waiting. Is there a way 2 complete insta