<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: How to translate double quotes to underscore?</title><link>https://www.infopathdev.com:443/forums/thread/103849.aspx</link><pubDate>Mon, 07 Sep 2015 16:08:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:103849</guid><dc:creator>GuyBoswell</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/103849.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=103849</wfw:commentRss><description>&lt;p&gt;I find&amp;nbsp;these answers so helpful but the last little piece of the story doesn&amp;#39;t get spelt out for simple people like me.&amp;nbsp; I assume as there was no further conversation other people worked this out.&amp;nbsp; It took me a while so I will explain my understanding.&lt;/p&gt;&lt;p&gt;The translate function uses three strings (pieces of text) separated with commas.&lt;/p&gt;&lt;p&gt;The first string is the string you want to translate - probably a reference to a field or another function acting on a field.&lt;/p&gt;&lt;p&gt;The second string is a list of all the characters you want to replace.&lt;/p&gt;&lt;p&gt;The third string is a list of the replacement characters.&lt;/p&gt;&lt;p&gt;Search the first&amp;nbsp;string for characters in the second string.&amp;nbsp; If you find any count how far you are in to the second string and count the same number of characters in to the third string and use that character instead.&lt;/p&gt;&lt;p&gt;so translate(&amp;quot;horse&amp;quot;,&amp;quot;ehors&amp;quot;,&amp;quot;emous&amp;quot;) returns mouse.&amp;nbsp; h in horse is the second character in the second string so it is replaced with the second character of the third string which is m and so on.&amp;nbsp;&lt;/p&gt;&lt;p&gt;If the string of replacement characters is shorter than the string of characters to replace any characters at the end of the second string are replaced with nothing at all.&lt;/p&gt;&lt;p&gt;The solution translate(string1,concat(&amp;quot;£$%^&amp;quot;,&amp;#39;&amp;quot;&amp;#39;),&amp;quot;_______&amp;quot;) to replace special characters including&amp;nbsp;double quote &amp;quot; works like this...&lt;/p&gt;&lt;p&gt;The second string is made up of two concatenated&amp;nbsp;strings.&amp;nbsp; First everything within the double quotes, i.e. £$%^&amp;#39; (which includes the single quote &amp;#39;) and then everything inside the single quotes, i.e. a double quote &amp;quot;.&amp;nbsp; So the second string is the six characters £$%^&amp;#39;&amp;quot; or pound dollar percent hat single quote double quote.&amp;nbsp; Because this is the output of the function concat() it doesn&amp;#39;t need to be contained in quotation marks, either single or double, these can be assumed to exist.&lt;/p&gt;&lt;p&gt;The third string has the same number of characters (six underscores) as the second string.&amp;nbsp; So every character in the second string can be replaced with the matching character from the third string.&lt;/p&gt;&lt;p&gt;&amp;nbsp;i.e. you give me a piece of text stored in a location called string1 and I give you back the same piece of text but with any pound, dollar, percent, hat, single quote or double quote characters replaced with underscore characters&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: How to translate double quotes to underscore?</title><link>https://www.infopathdev.com:443/forums/thread/91959.aspx</link><pubDate>Tue, 06 Aug 2013 07:51:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:91959</guid><dc:creator>DrumZHeaD</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/91959.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=91959</wfw:commentRss><description>&lt;p&gt;Awesome! I use the first solution and it completely works. I spent about couple days on this issue actually.&lt;/p&gt;
&lt;p&gt;Thank you very much.&lt;/p&gt;
&lt;p&gt;By the way, please allow me to ask some stupid questions. Although the formula works, I quite confuse about its function, so would you please explain some more detail about this formula?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;One.&lt;/p&gt;</description></item><item><title>Re: How to translate double quotes to underscore?</title><link>https://www.infopathdev.com:443/forums/thread/91958.aspx</link><pubDate>Tue, 06 Aug 2013 07:08:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:91958</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/91958.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=91958</wfw:commentRss><description>&lt;p&gt;Please give this a try:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;translate(field1, concat(&amp;quot;,:;&amp;#39;&amp;quot;, &amp;#39;&amp;quot;&amp;#39;), &amp;quot;_____&amp;quot;)&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Alternatively, you can use your approach and have a reference field with all the escapable characters, but you should specify it like this:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;translate(field1, reference, &amp;quot;__________&amp;quot;)&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;In other words, &lt;strong&gt;reference&lt;/strong&gt; should not be in quotes.&lt;/p&gt;</description></item><item><title>How to translate double quotes to underscore?</title><link>https://www.infopathdev.com:443/forums/thread/91957.aspx</link><pubDate>Tue, 06 Aug 2013 04:46:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:91957</guid><dc:creator>DrumZHeaD</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/91957.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=91957</wfw:commentRss><description>&lt;p&gt;I try using formula to replace special characters to underscore:&lt;/p&gt;
&lt;p&gt;translate(field1, &amp;quot;,, :, ;, &amp;#39;, &amp;quot;&amp;quot;, &amp;quot;_&amp;quot;)&lt;/p&gt;
&lt;p&gt;However, the formula contains error because of the double quotes. &lt;/p&gt;
&lt;p&gt;Would anyone please tell how to escape the double quotes for InfoPath 2010?&lt;/p&gt;
&lt;p&gt;I also try adding anoher field containing the double quotes as default value&amp;nbsp;and add&amp;nbsp;to the translate formula, but the result is all characters contained as the added field name are all eliminated.&lt;/p&gt;
&lt;p&gt;Example: field name &amp;quot;reference&amp;quot; is assigned with double quotes &amp;quot; as a default value. If I enter text &amp;quot;car&amp;quot;, the result is &amp;quot;a&amp;quot; (because it will eliminat all characters contained in the field name &amp;quot;reference&amp;quot;)&lt;/p&gt;
&lt;p&gt;Please help.&lt;/p&gt;
&lt;p&gt;Thank you very much&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;</description></item></channel></rss>