Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the IN Operator and the MS WORD Double Quote [ " ] [CR11]

Status
Not open for further replies.

0sprey

Technical User
May 9, 2015
81
CA

I have Cut and Pasted 50 SNs into a selection formula that utilizes the IN Operator to perform the selection {table.field} in ["SN1","SN2","SN3", ..."SN50"]
I used MS WORD and the Find and Replace function to create the string of character with the required DOUBLE QUOTES, COMMAS and SPACES added.
However, the selection formula will not work..... it seems like the DOUBLE QUOTE character [ " ] that MS Word uses is not compatible within CR11.... does this seem right ?

If so is there a work around ?



 
If Word used "Smart Quotes" (which actually curve in the appropriate direction) then that could be an issue.

Copy the formula and post it into NotePad or another text editor and do a global replace of " with '
 
This is the route I took that worked..... I am sure there is a shorter method....please let me know if one exists.
Most of the work was necessary to avoid using of the curly Word double quotes... but I had to use Word to do the replacing as Notepad could not Find and Replace the carriage returns in the data.



Cut the column of 300 SNs from Excel 2010 >> Paste to Notepad (to clear the Excel formatting)
Cut from Notepad >> Copy to Word 2010
Within Word use the Replace All feature to replace all carriage returns (with “; “) using the following :
Replace ^p with *, *
Cut form Word 2010 >> Paste back into Notepad
Within Notepad use the Replace All feature to replace the * with the correct type of “
(Not the Word curly type that does not work in CR 11 formulas)

Cut from Notepad and paste into the selection formula line as follows:

Example : {table.Serialnumber} IN [“454675856868”, “6768676745455”,…… for 300 SNs]
 
There is no need to use MS Word at all, and in fact is the source of your original problem.

Use Notepad (or a simple text editor) only. The Find and Replace function can be accessed using Ctrl+H, or via the Edit menu item.

Cheers
Pete

 
Pete,

I have tried (a lot) with Notepad and WordPad.

I cann0ot get either of these editors to "find" the "carriage return" in order to do the replacement.

I tried ^p and ^13 but neither worked. What character should I use to find the "carriage return" and replace it with ", ".

Word finds the "carriage return' using the ^p character.

Thanks Osprey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top