QPSMR Limited  
office: +44 (0) 1491 825644 
fax: +44 (0) 1491 832376 

QPSMR Facebook  QPSMR Twitter  QPSMR YouTube  


QPSMR Companion - Regular Expression Search and Replace

The QPSMR Companion [Paste special] [Block…] [Regular Expression search and replace] facility is really useful when copying and renaming sets of questions.  Below are a couple of simple examples, showing how to replace a letter at the start, and at the end of the entry names, so you can see how it’s done!
In the following project questions for Product A all begin with the letter A.  You will notice that filters FPRODA, FPRODB and FPRODC have already been made from the PROD entry (using [Insert] [Create filter entries from responses] [PROD] followed by right-click [Rename]) and are ready for use.
Replacing a letter at the start of the entry names
To copy the set of questions created for Product A and paste them for Product B (changing the first letter of the entry names from A to B):
Copy the set of questions for Product A
Select the toolbar icon QPSMR Companion Paste Special Icon ([Paste entries from clipboard with optional changes])

QPSMR Companion - Regular Expression 1
At the "Paste special" dialog box click [Block...] (at the bottom, to the left of the [Add] radio button)
At the "Block replace" dialog box click the [Regular expression search and replace] tick box
In the "Search for" box enter ^A
In the "Replace with" box enter B

QPSMR Companion - Regular Expression 2
Click [OK]

QPSMR Companion - Regular Expression 3
In the "Entries referred to by clipboard entries" box select FPRODA
In the box underneath update the text to be FPRODB
Click [Paste entries]

QPSMR Companion - Regular Expression 4
Notice the "Response restrictor" applied on entry B1A has automatically been updated to {B1}.

With the entries B1-B4 highlighted, from the Main window, select [Edit] [Text find and replace...].  In the “Search for” box type Product A and in the “Replace with” box type Product B and select [Text replace] [OK] [Close] to update the question texts.

This procedure could then be repeated for Product C entries.
Replacing a letter at the end of the entry names
If the entries in the questionnaire had been set up with the last letter of the name identifying the product, for example Q1A, Q1AA, Q2A, Q3AA, Q3BA, Q3CA, Q4A to replace the letter A at the end of the name with a B, the procedure described above is exactly the same, but at the "Block replace" dialog box:
In the "Search for" box enter A$
In the "Replace with" box enter B

This would mean that, once all of the steps had been followed, the new entries would then be named Q1B, Q1AB, Q2B, Q3AB, Q3BB, Q3CB, Q4B.
These are just two simple examples, the [Regular Expression search and replace] facility can be used to find and amend many different text strings in your project entries, see the QPSMR Companion on-screen help file for more examples and further information.


QPSMR Click Click for the QPSMR Favourite Features page