How to find and replace any string between " "

Hi everyone,
Here my sample
String szTest;
szTest = "Yellow banana";
szTest = "Blue monkey";
szTest = "Red mango";
szTest is only needed when it's in testing progress. Now I want to put all of that in the /*comment*/ so the released program won't run those code any more (but still keep szTest so I can use it for future develop testing).
So Here what I want after using the Find and Replace Box:
//String szTest; //Manual
/*szTest = "Yellow banana";*/ //use find and replace
/*szTest = "Blue monkey";*/ //use find and replace
/*szTest = "Red mango";*/ //use find and replace
I think I can do this with Regular expressions or Wildcards. But I don't know how to find and replace any string between " and ".
Find: szTest = " ??Any string?? ";
Replace with: /*szTest = " ??Any string?? ";*/
Thanks for reading.

Hi Nathan.j.Smith,
Based on your issue, I suggest you can try the Joel's suggestion check your issue again. In addition, I find a MSDN document about how to use the Regex.Replace Method to match a regular expression pattern with a specified replacement string,
maybe you will get some useful message.
https://msdn.microsoft.com/en-us/library/xwewhkd1(v=vs.110).aspx
If the above suggestion still could not provide you, could you please tell me what language you use to create the program for finding and replace any string using regular expression so that we will find the correct programming develop forum to support this
issue?
Best Regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • [Forum FAQ] How to find and replace text strings in the shapes in Excel using Windows PowerShell

    Windows PowerShell is a powerful command tool and we can use it for management and operations. In this article we introduce the detailed steps to use Windows PowerShell to find and replace test string in the
    shapes in Excel Object.
    Since the Excel.Application
    is available for representing the entire Microsoft Excel application, we can invoke the relevant Properties and Methods to help us to
    interact with Excel document.
    The figure below is an excel file:
    Figure 1.
    You can use the PowerShell script below to list the text in the shapes and replace the text string to “text”:
    $text = “text1”,”text2”,”text3”,”text3”
    $Excel 
    = New-Object -ComObject Excel.Application
    $Excel.visible = $true
    $Workbook 
    = $Excel.workbooks.open("d:\shape.xlsx")      
    #Open the excel file
    $Worksheet 
    = $Workbook.Worksheets.Item("shapes")       
    #Open the worksheet named "shapes"
    $shape = $Worksheet.Shapes      
    # Get all the shapes
    $i=0      
    # This number is used to replace the text in sequence as the variable “$text”
    Foreach ($sh in $shape){
    $sh.TextFrame.Characters().text  
    # Get the textbox in the shape
    $sh.TextFrame.Characters().text = 
    $text[$i++]       
    #Change the value of the textbox in the shape one by one
    $WorkBook.Save()              
    #Save workbook in excel
    $WorkBook.Close()             
    #Close workbook in excel
    [void]$excel.quit()           
    #Quit Excel
    Before invoking the methods and properties, we can use the cmdlet “Get-Member” to list the available methods.
    Besides, we can also find the documents about these methods and properties in MSDN:
    Workbook.Worksheets Property (Excel):
    http://msdn.microsoft.com/en-us/library/office/ff835542(v=office.15).aspx
    Worksheet.Shapes Property:
    http://msdn.microsoft.com/en-us/library/office/ff821817(v=office.15).aspx
    Shape.TextFrame Property:
    http://msdn.microsoft.com/en-us/library/office/ff839162(v=office.15).aspx
    TextFrame.Characters Method (Excel):
    http://msdn.microsoft.com/en-us/library/office/ff195027(v=office.15).aspx
    Characters.Text Property (Excel):
    http://msdn.microsoft.com/en-us/library/office/ff838596(v=office.15).aspx
    After running the script above, we can see the changes in the figure below:
    Figure 2.
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Thank you for the information, but does this thread really need to be stuck to the top of the forum?
    If there must be a sticky, I'd rather see a link to a page on the wiki that has links to all of these ForumFAQ posts.
    EDIT: I see this is no longer stuck to the top of the forum, thank you.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • SharePoint Calc Column - How to Find and Replace ANY & ALL Values with Something Else

    Haven't found a solution on this even though it seems like it should be cut and dry.
    I have a column containing characters "-" (e.g., XXX123-123-fjhrh-sdafsdfsd). I want to find every "-" and replace it with "@". Seems easy but so far haven't found a solution. My calc column always seems to stop at the first
    occurence of "-" and only replace that one. Seems every forumula wants you to tell SharePoint where to start (position). You can't simply tell SharePoint, Find this "-" ALL OCCURENCES and replace with this "@" ALL OCCURENCES.
    I don't have the option of saying start at this position because my data is not the same in every cell/field (e.g., number of characters).
    Closest I've gotten is this:
    =REPLACE([IN THIS COLUMN],FIND("-",[IN THIS COLUMN]),LEN("-","@")
    RESULTS:
    XXX@123-XXX-123

    Hi JJSHAREP,
    The formula only works when there are only three "-" in the column value, and the formula will fail if there are more than or less than three "-" in the column value.
    I recommend to use Jquery code to replace the characters in the column called IN THIS COLUMN in the UI:
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function () {
    var Index=0;
    $(".ms-listviewtable tr th").each(function(i){
    if($(this).find("div").attr("name")=="IN_x0020_THIS_x0020_COLUMN"){
    Index=i;
    $(".ms-listviewtable tr").each(function(i){
    if(i>0){
    var value=$(this).find("td").eq(Index).text();
    var value1=value.replace(/\-/g, '@');
    $(this).find("td").eq(titleIndex).text(value1);
    </script>
    Best regards.
    Thanks
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Find and Replace text string in HTML

    Opps... I hope this forum is not just for Outlook. My Html files reside on my hard-drive. I am looking for VBA code to open specified file names ####File.html and then find and replace text strings within the html for example "####Name" replaced
    with "YYYYY"
    I drive the "####File.html" names and the find and replace text strings from an Excel sheet. I am an artist and this Sub would give me time to paint instead of find and replace text. Thank you!
    [email protected]

    Hello Phil,
    The current forum is for developers and Outlook related programming questions. That's why I'd suggest hiring anybody for developing the code for you. You may find freelancers, for example. Try googling for any freelance-related web sites and asking such
    questions there.
    If you decide to develop an Outlook macro on your own, the
    Getting Started with VBA in Outlook 2010 article is a good place to start from.

  • How to find and replace data in form fields in acrobat xi, its not allowing to do so while trying, a

    how to find and replace data in form fields in acrobat xi, its not allowing to do so while trying, asking for adobe livecycle to get installed. please help.

    Easiest way to do it is the following:
    - Open the PDF file in Acrobat.
    - Go to Tools - Forms - More Form Options - Export Data.
    - Save the form data as an XML file somewhere on your system.
    - Open XML the file in a plain-text editor (I recommend Notepad++).
    - Let's say you want to replace all the years in the dates from "2013" to "2014". Do a global Search&Replace of "2013-" to "2014-" (I added the dash just to make sure that only date fields are edited).
    - Save the XML file (maybe under a new name).
    - Go back to the PDF file, and now go to Tools - Forms - More Form Options - Import Data.
    - Select the edited XML file and import it.
    - Done!

  • How to find and replace text in Excel with Automator

    I am new to Automator. And I would like some help how I can create a service that will allow me to find and replace certain text in Excel. I noticed that there is an action to do this for Word documents, but not for Excel document.
    Any suggestions how I can do this?
    Thanks so much for your help.

    Easiest way to do it is the following:
    - Open the PDF file in Acrobat.
    - Go to Tools - Forms - More Form Options - Export Data.
    - Save the form data as an XML file somewhere on your system.
    - Open XML the file in a plain-text editor (I recommend Notepad++).
    - Let's say you want to replace all the years in the dates from "2013" to "2014". Do a global Search&Replace of "2013-" to "2014-" (I added the dash just to make sure that only date fields are edited).
    - Save the XML file (maybe under a new name).
    - Go back to the PDF file, and now go to Tools - Forms - More Form Options - Import Data.
    - Select the edited XML file and import it.
    - Done!

  • How to find and replace certain text in Excel.

    I am new to Automator. And I would like some help how I can create a service that will allow me to find and replace certain text in Excel. I noticed that there is an action to do this for Word documents, but not for Excel documents.
    Any suggestions how I can do this?
    Thanks so much for your help.

    Marga,
    I think the best place to ask about Office for Mac would be in the MS forums.
    Jerry

  • How to find and replace multiple cells at a time

    I am doing repetitive work re find text in numbers but then replace following cells with text. How can I find and replace multiple cells at a time?
    i.e. doing my own budget spreadsheet and coding all transactions with description and code

    Did you try the "Find/Replace" dialog box?:
    Then click the "Replace All" button in the bottom left.

  • How to find and replace the text present in the url

    I have a column of type NCLOB with some text having url's in between as shown below:
    ========================================================================
    This text is for testign purpose.This text is for testign purpose.
    <A PL/SQL <U PL/SQL </U> </A>
    Thsi text is also for testign purpose.This text is for testign purpose.
    <A http://forums.oracle.com> <U oracle metalink> </U> </A>
    This text is for testign purpose.This text is for testign purpose.This text is for testign purpose.This text is for testign purpose.This text is for testign purpose.This text is for testign purpose.This text is for testign purpose.This text is for testign purpose.
    ========================================================================
    Requirement:
    ========
    Requirement is to implement the find and replace functionality.
    I just need to check whether the search text is present in the url or not?
    Suppose if search for orcale.com, since its part of the url so the search should be successful otherwise search should be unsuccessful.
    Here I can give you the hint like, always the url lies between the anchor tags *(<A </A>).*
    Tahnks in Advance.

    I had I think a similiar question the other day thay I Frank and Michaels answered for me.
    not sure if I totally have what you want but.
    WITH t
            AS (SELECT '<A PL/SQL <U PL/SQL Thsi text is also for testign purpose.This text is for testign purpose.
    <A http://forums.oracle.com> This text is for testign purpose.This text is for testign purpose.This text is for testign purpose.This text is for testign purpose.This text is for testign purpose.This text is for testign purpose.This text is for testign purpose.This text is for testign purpose.
                          txt
                  FROM DUAL)
    SELECT REGEXP_SUBSTR (REGEXP_REPLACE (txt, '(.*<A)|(</A>.*)'), 'oracle.com')
      FROM tthe first part the regexp replace part gets the text between a start and end point you mentioned that would be <A and </A>
    the regexp substr just looks for the phrase oracle.com in the text between those two points.
    Edited by: pollywog on Oct 6, 2010 8:26 AM

  • How To: Find and replace multiple words in one Click ?

    I have an file with about 150 Pages where I want to replace a word about 500 time by one click.
    Find and Replace works but only with one word.
    How can I do it by one click ?

    You can't, not in Acrobat anyway.
    This is the kind of thing that should be done in the original file format,
    not in a PDF.

  • How to find and replace with sequential values?

    im building a website. it contains 12 main images per page and luckily according to my design the source code per page contains 12 <img> tags only (rest is background and stuff). now for many pages i keep using a particular page as template and then change each and every image by browsing and clicking. Now i want to make my work easy.
    the images that i want to add in every page are sequentially file named.  001.jpg , 002.jpg .......... and so on.
    So is there some way that i can use find and replace , to find the <img> tags and fill them all with values sequentially that is the first <img> tag containts 001.jpg and the second containts 002,jpg and so on .
    the pages are many thats why i want to make this easy
    thanks very much for help

    Will they ever do this?   I just wish Adobe would purchase TextPad and integrate it into Dreamweaver.  In TextPad, from the manual:
    Other TextPad options in the replacement string:
    \i Generate a sequence number.
    \i(N,M) Ditto, starting at N and incrementing by M.
    So beautifully simple.

  • How to find and replacing the path (url) given for data binding from type 'datasocket'

    Hi everyone,
    I'm sorry to pose this question as my own knowledge is still very limited.
    I have an assignment (bachelor level). We were asked to adjust a plc program in step7 so that multiple of an existing sequence could be run indepently.
    The settings for that sequence are controlled by labview. Sensor data is also viewed in labview.
    There is an existing labview VI that was made by someone else before us. It uses 'Datasocket' type for data binding. Because we would like to adjust this VI to be used with the other sequences, we would like to change the original path or URL quickly, as in a 'Find&Replace' solution. Yet the find and replace only works for objects or text, not entries in the properties.
    Can someone please tell me if there is a way to do is, without having to use shared variables, as we are not at all known with this type.
    Many thanks,
    Niels

    Dear Niels,
    Please find the attached example. I placed 5 controls on the front panel, all with a data socket URL (control 1 = URL1, control 2 = URL2 etc). Through property nodes I did the following;
    - I got a reference to the front panel
    - with this reference we can get an array of references to the controls on this front panel
    - one by one we will read the references and check the data socket URL from the control, we compare this with the URL we are searching
    - if found, stop we will use the reference to write a new URL to the control.
    Please notice the default values of the controls; it is set to search for URL3 and replace this with URL10, run the VI once and you will see that happening. I also included a sting indicator which will show you the label of the control which we find. Also a Boolean indicator in case we were not able to find the URL.
    I downsaved the VI to 8.6, I'm not sure in which version you are working, if you have 8.6 or higher you are able to open it. Hope this brings you further,
    Best regards,
    Martijn S
    Applications Engineer
    NI Netherlands
    Attachments:
    findURLexample.vi ‏12 KB

  • How to search and replace a string in Excel Shape (textbox) using Powershell.

    I have been asked to write a PS script to search/replace a string when found in Excel Shapes when they are textboxes. I have seen lots of simplistic PS scripts and even I can do a "foreach" loop through all the Shapes on a Sheet and display the
    Name of each Shape. But I have not found a property or method to expose the actual text in a textbox let alone change it.
    I have seen vba script that does this as:  
    Set xWs = Application.ActiveWorkbook.Worksheets(I)
    For Each shp In xWs.Shapes
    xValue = shp.TextFrame.Characters.Text
    shp.TextFrame.Characters.Text = VBA.Replace(xValue, xFindStr, xReplace, 1)
    Next
    In Powershell, shp.TextFrame.Characters.Text is ignored and returns nothing.  It would be nice to know if this is possible in PS and if so, know how to do it and/or get an example to work from.  I would have thought that
    PS and VB would use the same Excel object model but apparently they do not.
    I am using Excel 14.0 and PS 3.
    Any suggestions would be appreciated,
    Michael

    This didn't work for me.  I have the shape object and it shows the textframe property:
    PS C:\> $shape | gm
       TypeName: System.__ComObject#{00024439-0000-0000-c000-000000000046}
    Name                       MemberType Definition
    Apply                      Method     void Apply ()
    CanvasCropBottom           Method     void CanvasCropBottom (float)
    SoftEdge                   Property   SoftEdgeFormat SoftEdge () {get}
    TextEffect                 Property   TextEffectFormat TextEffect () {get}
    TextFrame                  Property   TextFrame TextFrame () {get}
    TextFrame2                 Property   TextFrame2 TextFrame2 () {get}
    ThreeD                     Property   ThreeDFormat ThreeD () {get}
    But trying to access it gives an error:
    PS C:\> $shape.textframe | gm
    gm : You must specify an object for the Get-Member cmdlet.
    At line:1 char:20
    + $shape.textframe | gm
    +                    ~~
        + CategoryInfo          : CloseError: (:) [Get-Member], InvalidOperationException
        + FullyQualifiedErrorId : NoObjectInGetMember,Microsoft.PowerShell.Commands.GetMemberCommand
    PS C:\> $shape.TextFrame.Characters().text="hello"
    You cannot call a method on a null-valued expression.
    At line:1 char:1
    + $shape.TextFrame.Characters().text="hello"
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : InvokeMethodOnNull
    I hope this post has helped!

  • Is it possible to find and Replace a string inside a textfile using JSP?

    FileInputStream fs = new FileInputStream("/opt/Abhishek/software/tomcat/webapps/AMS/listpass");
    DataInputStream in1 = new DataInputStream(fs);
    while (in1.available() !=0)
    String str1=in1.readLine();
    StringTokenizer st1 = new StringTokenizer(str1);
    String node=st1.nextToken();
    if (node.equals(sports))
    String pass=st1.nextToken();
    out.println ("<b>"+sports[i]+" <b>");
    out.println("**Your Required Password**");
    out.println(pass);
    out.println("<br></br>");
    %>
    Hi ,
    I have a text file (named listpass in the above code) inside tomcat-webapps folder containing a node name and its password.You could see the path of the text file at the starting line of the code.The Scene behind the program is once the particular node is clicked the password is retreived for the user against the particular node.What i would need is to change the password in the text file once it is retreived. So i would need to find the password that is retreived recently and change that one with a randomnly generated new password in the text file.
    So can i do this?Is it possible to search for the string in the text file and replace that with a new one using JSP.For your note i am running all my HTML amd JSP inside the same folder where i have the text file in which the string has to be replaced .
    Could anyone give your comments on this please?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Nasty in so many ways.
    First off you shouldn't be doing stuff like this in a JSP. JSPs should just build HTML, use a Servlet and then pass data to a JSP for formatting.
    Web applications are multi-threaded, so you have to consider what happens if several of these transactions come in at the same time, each trying to change the same data file.
    It's not practical to amend text files in place, generally you have to create a new version of the file for each change because if the size of a password changes the subsequent bytes of the file would all need moving.
    Use a database. Databases are designed to deal with these issues and there are perfectly good free ones around like Derby, MySQL and H2.

  • Anyone know how to find and replace a hard drive cable fo an HP Pavilion zv5160us laptop?

    I received message that my hard drive had failed.  I ordered an identical drive and replaced it.  I now get error message:
    PXE-E61:  Media test failure, check cable
    PXE-M0F:  exiting PXE ROM
    The recovery disks will not reformat the drive.  What does the cable look like.  Can it be replaced?  Where could I find one?
    Thanks for any help as I have bought new hard drive, more memory and recovery disks.  Hate to lose my investment completely.  Should have just bought a new laptop!

    Hi,
    Should be ok to put new WD HDD on your dv6 machine. All connectors are standard. Please watch the following videos to see some idea of this work:
        http://www.youtube.com/watch?v=CP0WYzpKYKk
       http://www.youtube.com/watch?v=QQx7PlIXFuE
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

Maybe you are looking for

  • How do I get and set column attributes in a table or a treetable with Java?

    Using 11.1.1.4.0 Hi, How do I get and set column attributes in a table or a treetable with Java? For a simple example, say I have a table and want certain roles to see all columns (including address), and other roles can see only certain columns (no

  • PO update for SES and ME2N

    I have following situation: PO created for $5000 for service- SES created for 1070, MIRO created and paid for 1070 ( $ 70 is or tax) PO history tab shows SES for $1070: GR for $1070 and IR for $1070 However, when I go into ME2N it shows Still to be d

  • Macbook Pro is Running very Slow. Help Please

    My Mac is running very slow does anyone have some tips please EtreCheck version: 2.1.8 (121) Report generated March 9, 2015 9:43:12 AM GMT+02:00 Download EtreCheck from http://etresoft.com/etrecheck Click the [Click for support] links for help with n

  • IPhoto isnt recognising my IPhone 4S anymore

    iPhoto isnt recognising my IPhone 4S anymore. Cant download photos or video into my iPhoto after a recent update

  • How to see data records of idoc?

    Hi Can anybody tell me how can i see the data records of idoc.. i think its stored in EDID4 table..but i am not able to see the sdata field