Impossible string replacement (replace \' by '' )
Hello,
I would like to replave sequence of character \' by '' in a string.
I did a lot of tests but it never worked!
Here is the code I have now
szTemp = szTemp.replaceAll("\\\'""''");
Thanks in advance for your help
Alain.
OK, just to make it more clear... :)
In the first string of replaceAll function I have 3 backslash and 1 simple cote and in the second string I have 2 simple cote.
Alain.
Similar Messages
-
Search for string and replace with frame break
Hello there,
We're using an InDesign CS6 Server for creating print data. The problem relates to our documents that consist of several connected text frames.
Situation:
The texts are exported from our database into InDesign via xml and so some automated editing in javascript. These texts contaion several paragraphs with headlines. Sometimes after the import the layout just looks bad, because the first textfield contains the fist paragraph and the headline of the second paragraph including some lines of text. Sometimes this behaviour is desired and sometimes not.
Workaroud:
We definde the string #*# to be our placeholder for line breaks. During the creation of the xml this string gets replaced by unicode for the hard line break (
).
Desired Solution:
This workaround has some disadvantages and we want our placeholder string to be translated to a frame break.
Until now I have neither found any definition for the unicode translation of the frame break nor a script based solution that just replaces this string with a frame break. any help is appreciated.
RegardsInstend of define string add attribute in xml or DB
e.g attribute name frame break="frame break"
after that through find the attribute get the insertion ponint and apply "SpecialCharacters.FRAME_BREAK" -
APEX application or page url - How to use enum string to replace ID number
URL to a APEX page is format as ***/f?p=APPLICATION_ID:PAGE_ID:... . Here the APPLIACTION_ID and PAGE_ID are numbers.
My Question is: Is there a way to replace the numbers by using strings? For example: can I have a URL like /f?p=MY_APPLICATION:MY_PAGE1: ... ? Juts like ENUM in other languages, MY_APPLICATION actually just represent the application id but much more readable since it is a string with a name the user may familar.
Please help.
Thank you.You can assign an alphanumeric alias to applications and pages using their respective attribute edit forms in the Application Builder. Then you can construct links that use those aliases instead of the IDs. These aliases will generally be preserved in the URL visible in the browser, but not in all cases. You have to deliberately use the aliases in any branch definitions, list item targets, etc. Note that application aliases must be unique within a workspace. Please see the User's Guide for more info.
Scott -
Search and Replace String Function replaces line feeds when I only want spaces replaced?
I need to replace every instance of a space or series of spaces in a multi line string with commas (or tabs) so I can dump it into a spreadsheet.
I am using the regular expresion [\s]+ and it works but it is also replacing the end of lines (\r\n) too.
How can I make it replace the spaces but leave teh end of lines intact?
Solved!
Go to Solution.
Attachments:
replace.vi 6 KBRight click on the search string and change it to '\' Code Display. Enter the space character (\s) correctly - you've got \\s right now.
-
Xquery concat / string-join / replace
Hi, I am a newbie on Xquery.
And I need some help on a problem I been having.
My in data is three digit numbers (ex. "123" "321" "213" etc). And I need to separate this with a comma ",". The problem is how do I do this if the input is only one item?, and second how do I not
put a "," on the last item?
I have tried a for-loop where a concat my string with with "," but the result is "123, 321, 213,". I do not want the last comma. And the spaces is not real whitespaces. I don't know where this comes from, the can not be removed or be used to
replace them with a comma (which would be the simplest way to solve my problem) but doesn't work.
for $Something in $Something/ns0:Something
return
fn:concat(data($Something)," ",",").
This returns "123, 321, 213,".I have solved it.
string-join(( data($Something/SomethingElse)),",")
Thanks. -
C# Script Task string variable replace wont replace
The code below ought to replace "A" with "B" but it doesnt.
Please tell me how to make this work. Thanks!Doug,
it returns a new string (does not assign to the same)
So you need fn = fn.Replace("A", "B");
Arthur
MyBlog
Twitter -
I have the following xml in String format. I'm only showing one XMLWorkFlowTask node, but there are potentially many in my application. I would like to replace all occurrences of the <sch:Title> node (located in the <sch:XMLWorkflowNode> node) with <sch:Title2>. Does anyone know of a way to do this?
<XMLWorkFlowTask>
<sch:TaskID>jbpm$17011</sch:TaskID>
<sch:Desc>daiswf:genericFundingRequestTask</sch:Desc>
<sch:Title>daiswf:genericFundingRequestTask</sch:Title>
<sch:PooledGroup>FINA_ADMIN</sch:PooledGroup>
<sch:DateCreated>2008-12-10T10:30:44.000-06:00</sch:DateCreated>
<sch:DateDue>2008-12-12T10:30:00.000-06:00</sch:DateDue>
<sch:Status>Not Yet Started</sch:Status>
<sch:WorkflowInstanceID>jbpm$2472</sch:WorkflowInstanceID>
<sch:Outcome/>
<sch:Action>initDefaultTask</sch:Action>
<sch:AgencyName>Jane Addams Hull House Association</sch:AgencyName>
<sch:Project>Mid Southwest and Southeast and Northeast</sch:Project>
<sch:GrantApplicationID/>
<sch:GrantAwardID/>
<sch:GrantCloseOutID/>
<sch:FundingRequestID>800</sch:FundingRequestID>
<sch:OrganizationName>Jane Addams Hull House Association / Mid Southwest and Southeast and Northeast</sch:OrganizationName>
<sch:FundNum>0893</sch:FundNum>
<sch:XMLWorkflowTaskDefinition>
<sch:TaskDefinitionID>daiswf:genericFundingRequestTask</sch:TaskDefinitionID>
<sch:XMLWorkflowNode>
<sch:Name>coverSheet</sch:Name>
<sch:Title>Create Contract/Amendment Cover Sheet for Scan</sch:Title>
<sch:Desc>N/A</sch:Desc>
<sch:XMLWorkflowTransition>
<sch:TransitionID>Task Done</sch:TransitionID>
<sch:Title>Task Done</sch:Title>
<sch:Desc>Task Done</sch:Desc>
<sch:Default>true</sch:Default>
</sch:XMLWorkflowTransition>
</sch:XMLWorkflowNode>
</sch:XMLWorkflowTaskDefinition>
<sch:WorkflowActive>true</sch:WorkflowActive>
<sch:Department>CONTRACTS</sch:Department>
<sch:OriginatedBy>hs00577</sch:OriginatedBy>
</XMLWorkFlowTask>if you are using jdom API then
SAXBuilder builder = new SAXBuilder(false);
Document objDoc = builder.build(strXmlDoc);
Element objRootElement = objDoc.getRootElement();
Namespace objNameSpace = Namespace.getNamespace("sch",
"http://url");
Element objParentOfWorkTask = objRootElement.getChild("ParentOfWorkFlowTask");
List objLstXmlTasl = objParentOfWorkTask.getChildren("XMLWorkFlowTask");
for(int numCnt = 0; numCnt < objLstXmlTasl.size(); numCnt++) {
List objLstTitle = ((Element) objLstXmlTasl.get(numCnt)).getChildren("Title", objNameSpace);
for(int numAntCnt = 0; numAntCnt < objLstTitle.size(); numAntCnt++) {
((Element) objLstTitle.get(numCnt)).setName("Title2");
} -
XML / XSLT :: String value replace
Hello,
I have XML configuration files that's look like this :
<dynamical.configuration.notwork.AdapterConfiguration>
<name>adapter demo</name>
<tool__version>1.0</tool__version>
<module>cadence</module>
<basedir>fun</basedir>
<output__dir>outputdir/</output__dir>
<output__temp__dir>dir/%name%/</output__temp__dir>
</dynamical.configuration.notwork.AdapterConfiguration>I would like replace %name% variable by the key "name" previously defined. I know that's I can use XSLT file for processing this files, but I don't know how ?
I try to write something like that
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>Adapter parameter</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Module</th>
<th>Name</th>
</tr>
<xsl:for-each select="dynamical.configuration.notwork.AdapterConfiguration">
<tr>
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="module"/></td>
<xsl:if test="contain(@module,'%')">
<xsl:value-of select="."/>
</xsl:if>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>My ant script :
<project name="xslt test" default="default">
<target name="default">
<xslt style="basic_template.xslt" in="test-input-adapterconf.xml" out="new-adapterconf.xml" />
</target>
</project>Thanks in advance..
I have already waste a lot of time..
notice : these xml files are generated by XStream library.
I get information about XSLT (http://nwalsh.com/docs/tutorials/xsl/xsl/slides.html#xsl-variable)phpvik wrote:
Yes, you right...
%name% have to be replaced, then
<output__temp__dir>dir/%name%/</output__temp__dir>
become <output__temp__dir>dir/adapter demo/</output__temp__dir>
because <name>adapter demo</name> is well defined.Try this XSLT:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8" indent="yes" />
<xsl:template match="/">
<xsl:for-each select="dynamical.configuration.notwork.AdapterConfiguration">
<dynamical.configuration.notwork.AdapterConfiguration>
<xsl:variable name="name" select="name"/>
<name>
<xsl:value-of select="$name"/>
</name>
<tool__version>
<xsl:value-of select="tool__version"/>
</tool__version>
<module>
<xsl:value-of select="module"/>
</module>
<basedir>
<xsl:value-of select="basedir"/>
</basedir>
<output__dir>
<xsl:value-of select="output__dir"/>
</output__dir>
<output__temp__dir>
dir/<xsl:value-of select="$name"/>/
</output__temp__dir>
</dynamical.configuration.notwork.AdapterConfiguration>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>Thanks,
Tejas -
Replace replace with regular expression possible?
Hi,
Just another regular expression question!
I want to replace the words "AND", "OR", "NOT" in a sentence with the symbols '&', '|', '~' respectively.
Obviously very simple to do with 3 replace statements, just wonder if I can use regexp_replace to achieve it?
CheersHi,
Metacharacter symbols can be used in place of regular expressions.
Here's an implementation scenario:
http://www.oracle.com/technology/obe/obe10gdb/develop/regexp/regexp.htm
Hope it helps.
Regards,
Naveed. -
Can I pay Apple to replace my IPod screen and if possible how much would it cost?
Apple will exchange your iPod for a refurbished for $149. They do not repair yours.
Apple - Support - iPod - Repair pricing
A third-party place like the following is less expensive. Google for more places.
iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens -
Replacement replacement phone?
Recently I lost my phone biking on a a camping trip and filled out a claim to replace that device and Sim card. When I did it was approved for a new galaxy mega 2. I didn't see an option to change the device to something else like a galaxy s4 or maybe an iPhone 4 s or 5 s. I figured the 6 inch screen would only be good for videos or something of the like. I work in construction and security fire alarm systems and having this huge thing with a heavy duty case for protection is a real pain. I thought I'd get used to it but I still can't stand it. The phone works great, but the size is just unnecessary. Has anyone ever taken a replacement phone into a store to be replaced? I've only had it about a month or so.
The replacement phone should be the same model as the one lost, or a similar model as possible. You can try to get a smaller replacement, but Asurion is under no obligation to change the phone again.
You could always sell the phone, locked to ATT and purchase a replacement you like. -
I traveled to a different country and using a new sim/new carrier. With the change in the sim, I have been unable to use the iMessage--outside of WiFi coverage area, and FaceTime at all time. I believe it is due to the phone number registered as an address in the phone, which has not changed with the change of sim; so it countinues to showing as an error while varifying the data.
Wonder if any of you are in a position to advise as to how to address the following.
1. I need to input correct phone no, meaning the number I am using in the correct location.
2. I need to activate FaceTime and be able to use it.
3. I need to be able to use iMessage and/or ordinary sms while outside of WiFi coverage area.
It may be mentioned in my current location I don't have GPRS on the cell phone which is the case in my regular station.
Thanks for your help.for #1
Frequently asked questions about Apple ID - Apple Support
I have multiple Apple IDs. Is there a way for me to merge them into a single Apple ID?
Apple IDs cannot be merged. You should use your preferred Apple ID from now on, but you can still access your purchased items such as music, movies, or software using your other Apple IDs.
If you are wondering how using multiple Apple IDs relate to iCloud, see Apple IDs and iCloud.
for #2
Apple does not accept unsolicited ideas see Apple - Legal - Unsolicited Idea Submission Policy -
Find & replace part of a string in Numbers using do shell script in AppleScript
Hello,
I would like to set a search-pattern with a wildcard in Applescript to find - for example - the pattern 'Table 1::$*$4' for use in a 'Search & Replace script'
The dollar signs '$' seem to be a bit of problem (refers to fixed values in Numbers & to variables in Shell ...)
Could anyone hand me a solution to this problem?
The end-goal - for now - would be to change the reference to a row-number in a lot of cells (number '4' in the pattern above should finally be replaced by 5, 6, 7, ...)
Thx.Hi,
Here's how to do that:
try
tell application "Numbers" to tell front document to tell active sheet
tell (first table whose selection range's class is range)
set sr to selection range
set f to text returned of (display dialog "Find this in selected cells in Numbers " default answer "" with title "Find-Replace Step 1" buttons {"Cancel", "Next"})
if f = "" then return
set r to text returned of (display dialog "Replace '" & f & "' with " default answer f with title "Find-Replace Step 2")
set {f, r} to my escapeForSED(f, r) -- escape some chars, create back reference for sed
set tc to count cells of sr
tell sr to repeat with i from 1 to tc
tell (cell i) to try
set oVal to formula
if oVal is not missing value then set value to (my find_replace(oVal, f, r))
end try
end repeat
end tell
end tell
on error number n
if n = -128 then return
display dialog "Did you select cells?" buttons {"cancel"} with title "Oops!"
end try
on find_replace(t, f, r)
do shell script "/usr/bin/sed 's~" & f & "~" & r & "~g' <<< " & (quoted form of t)
end find_replace
on escapeForSED(f, r)
set tid to text item delimiters
set text item delimiters to "*" -- the wildcard
set tc1 to count (text items of f)
set tc2 to count (text items of r)
set text item delimiters to tid
if (tc1 - tc2) < 0 then
display alert "The number of wildcard in the replacement string must be equal or less than the number of wildcard in the search string."
error -128
end if
-- escape search string, and create back reference for each wildcard (the wildcard is a dot in sed) --> \\(.\\)
set f to do shell script "/usr/bin/sed -e 's/[]~$.^|[]/\\\\&/g;s/\\*/\\\\(.\\\\)/g' <<<" & quoted form of f
-- escape the replacement string, Perl replace wildcard by two backslash and an incremented integer, to get the back reference --> \\1 \\2
return {f, (do shell script "/usr/bin/sed -e 's/[]~$.^|[]/\\\\&/g' | /usr/bin/perl -pe '$n=1;s/\\*/\"\\\\\" . $n++/ge'<<<" & (quoted form of r))}
end escapeForSED
For what you want to do, you must have the wildcard in the same position in both string. --> find "Table 1::$*$3", replace "Table 1::$*$4"
Important, you can use no wildcard in both (the search string and the replacement string) or you can use any wildcard in the search string with no wildcard in the replacement string).
But, the number of wildcard in the replacement string must be equal or less than the number of wildcard in the search string. -
Replacing inconsistant spacing with single space in a string
is it possible to replace multiple spaces within a string with one space only. Number of spaces is different all the time.
say one field contains strings with imbedded spaces
I need to replace all these values so that there will be only one space between words.
For Eg.
Input Expected Result
aaa bbb aaa bbb
ww vv ww vv
ww ss kk ww ss kk
[/code]user11253970 wrote:
I am in Oracle 9i :( I can not use reg exp
Assuming strings do not contain CHR(0) (character with ascii code 0):
SQL> SELECT 'aaa bbb aaa bbb' str,
2 replace(replace(replace('aaa bbb aaa bbb',' ',' ' || CHR(0)),CHR(0) || ' '),CHR(0)) new_str
3 FROM dual
4 /
STR NEW_STR
aaa bbb aaa bbb aaa bbb aaa bbb
SQL> SY. -
Search and Replace a string t-SQL
Everyone I am trying to write a query to replace all occurrences of a string at the end. I have some noise words(104 to be exact) that need to be removed from the string if they appear at the end.
Two noise words for example are --Company, LLC
Here are some examples and expected output:
American Company, LLC --Expected output --American (both noise words should be removed)
American LLC,LLC --Expected output -- American
American Company American Company-- American Company American (one noise word occurs in between other words, so it should not be removed)
currently I have this query:
DECLARE @NEWSTRING VARCHAR(max)
DECLARE @NEWSTRINGlength nvarchar(max)
SET @NEWSTRING = 'American Company American Company Company, LLC LLC' ;
SET @NEWSTRINGlength = len(@newstring)
SELECT @NEWSTRINGlength
CREATE TABLE #item (item Nvarchar(250) null)
INSERT INTO #item
SELECT 'Company' as item
UNION ALL
SELECT 'LLC' as item
DECLARE @unwantedCharecters VARCHAR(50) = '%[~,@,#,$,%,&,*,(,),.,!, ]%'
WHILE PATINDEX( @unwantedCharecters, @NEWSTRING ) > 0
SELECT @NEWSTRING = ltrim(rtrim(Replace(REPLACE( @NEWSTRING, SUBSTRING( @NEWSTRING, PATINDEX( @unwantedCharecters, @NEWSTRING ), 1 ),''),'-',' ')))
SELECT @NEWSTRING = substring(rtrim(@NEWSTRING), 1, len(@newstring) - len(ITEM)) FROM #item WHERE rtrim(@NEWSTRING) LIKE '%' + ITEM
Each occurrence of the noise word should be removed, unless they appear in between other words.Here's how I'd do it...
1) If you don't have a sting splitting function, create one. (I can supply code if needed)
2) Use the function to split the string into a table , using spaces as a delimiter.
'American Company American Company Company, LLC LLC' would look like this...
StringID Word Position
1 American 1
1 Company 2
1 American 3
1 Company 4
1 Company, 5
1 LLC 6
1 LLC 7
3) Do the same with your "noise word" list
4) Left join the "SplitNoiseWord" table to your "SplitCompName" table.
5) Find the last occurrence of a NULL match for each StringID (max Position where SNW is NULL) and delete everything after that.
6) Use FOR XML PATH to reassemble the strings, using a space as a delimiter.
HTH,
Jason
Jason Long
Maybe you are looking for
-
Frm-41380 error - cannot set the blocks query data source
Fairly new forms so bare with me. I am creating a form based on one table. This table has one column that is a nested table. table name: szrtime table columns: szrtime_code, szrtime_styp_list szrtime_styp_list is a table of varchar2(1). main block is
-
House bank for respective payment method.
Hi Gurus, I would like to consider house bank for payment method wise. Please give proper answer. reg.
-
Hi Experts, I am implementing HR(Personnal Administation & Organizational Management) first time. For any master data Is it require to maintaine Hierarchies for masterdata. If require can u please give me the list of those. Regards, Sridhar
-
I want to delete all of my contacts/addresses in Mail
How can I delete all of my mail addresses? I have thousands and many duplicates I want to start fresh.
-
HT2518 I can't open MOV. files on my new mac, please help
Hi I'm new to mac's and I love my new toy, but I'm having a little problem with transferring my video's from my old PC. I've tried manually transferring my mov. files from my PC hard drive to my mac. All the videos used to open up on the PC with Quic