Replacing Text with Spaces

What is the fewest lines of code needed to transform:
'this is a test--have a look'
with
'this is a test'
the idea is to find the '--' in the string and blank out everything after that.
    Thank-You

>
Tom Matys wrote:
> Rob, I try to use this forum quite seriously. If my question was incomplete you can let me know.
>
> Otherwise, I suggest you read "The Rules of Engagement"
>
> Step 5: Answering a question
> The community lives by people like you, trying to help others. When you see an unanswered question where you think you can answer, do so and help the poster. Remember to be polite and if you do not completely understand a question and need more details, request more information from the poster.
>
>                   Thank-You.
Good point - let me explain
I don't think the rules of engagement say this, (at least I don't see it) but if you expect a good answer, you have to ask a good question. I think that if you check, you'll see that my answer completely and correctly answers the question that you actually asked. (I tested it.)
But to be fair, my answer was meant to ask to think about what you are asking and why you are asking such a question. Is your server so limited in storage space that you have to be concerned about the physical size of programs. Or is the question meant to be performance related? Or something else entirely?
But also to be fair, you have asked almost 500 questions and seem to be asking the forum a question that you really ought to think about yourself. Those rules of engagement also talk about searching for a solution before asking and explaining what you have done to find a solution in your question.
Rob

Similar Messages

  • Use Powershell to replace text with image in Word document

    I have a powershell script that uses a Word document as a template to create signatures that I am pushing out to my organization.
    The document is populated with text formatted the way I want the signature to look, that I then do a FindText and ReplaceText on.  This works fine for replacing text with text, but I can't figure out how to properly replace some of the holder text with
    an image and a link.  I found a few posts about adding images to word documents, but none that seem to work properly in this scenario.
    Any insight would be greatly appreciated, thanks!

    Dear BOFH,
    You are correct that method I outlined is not for inserting an image into a signature block (which would be in Outlook, not Word).  The links you post do certainly deal with outlook signatures, well done... Except that the question was about how to
    use a Powershell script to replace text in a Word document with an image.  Sure it was framed in the context of creating signatures, but the poster expressed that they already had a method of generating and replacing text, and just needed to know, as
    I did, how to do the thing they actually asked.
    Please BOFH... Please forgive my audacity in hoping to find a reference (any reference) to how to replace Word text with images via Powershell in a thread titled "Use Powershell to replace text with image in Word document".
    This is certainly a scripting question, and even something as simple as "You will need to call the .NET methods for the Word find/replace functionality.  Please ask in the Word forums for the correct method to use. 
    If you need help on calling .NET methods look HTTP ://here"support you offered combined with the contempt you offer in response to my actual substantive help to the actual question asked.
    BOFH, you are not better than us, just more arrogant.
    Can you please start your own question as this one has been closed.  Please see scripting guidelines.
    We cannot guarantee you satisfaction as this is a user supported forum.  The is no SLA for community support.  Perhaps if you posted a better worded question as a new topic someone might be able to help you resolve your issue.
    The topic you are posting on is closed and answered.
    ¯\_(ツ)_/¯

  • Preventing Discoverer Admin replacing underscores with spaces on refresh

    Hello,
    On refreshing a Business Area, Discoverer Administrator will automatically replace underscores with spaces for any new items/folders to be incorporated. I would prefer this not to happen i.e. the names should retain the underscores. I haven't found any way to do this from within Discoverer Admin - are there some registry settings that I can tweak or is it just not possible,
    Thanks in anticipation,
    Kevin.

    Hi,
    Well, you could try using a eul_trigger$refresh_new_column trigger. I must admit I have never tried this, but the details are in the documentation (http://download.oracle.com/docs/html/B13916_04/appendix_b.htm#sthref2417).
    Rod West

  • Lion replaces text with 'block A' characters in safari

    about 1/4 of the sites i vist now (including my own--in safari) have a 'block A' character where there is html text.
    does anyone know how to fix this?
    thanks.

    There are two articles on MacFixit about this.
    Fonts are implicated in both.
    http://reviews.cnet.com/8301-13727_7-20087102-263/webkit-sandboxing-conflict-cau ses-safari-block-a-font-problem/
    http://reviews.cnet.com/8301-13727_7-20085570-263/safari-in-os-x-lion-replacing- text-with-block-a-characters/
    Clearing caches and booting to Safe Mode has helped the majority of people experiencing this problem; however, for a few people the problem returns after a while, indicating that either Safari itself or the system's font configuration may be actively corrupting the font cache.
    .... (example)
    - If this happens, then unfortunately the approach would be to systematically disable system fonts using Font Book until the problem goes away, and then remove the specific fonts that are contributing to the problem.

  • Applescript   replace text with clipboard

    Sorry if this has been asked before, I have been searching for hours and cannot find anything.
    what I would like to do is copy text from a safari webpage , swap to the textedit program and replace text with the copied contents.
    for eg.
    from safari I have copied the user link, I then want it to swap over to textedit, find the keyword "userlink" and replace it with the copied content from safari
    userlink
    email
    number
    HHopefully I have explained it correctly, and thanks in advance for any help

    Hi,
    Like this:
    set x to the clipboard as «class RTF »
    tell application "TextEdit"
        set first word of front document whose it = "userlink" to x
    end tell
    If you want plain text, remove as
    as «class RTF »

  • Hi, Im using apple 5s with gold color , I want  to replace it with space grey  color .Is it possible in apple store?

    Hi, Im using apple 5s with gold color , I want to replace it with space grey color .Is it possible in apple store?

    If you are within the return period policy of the retail where you purchased the
    iPhone, return it and buy a new one. If outside the return period, sell the current
    iPhone privately and use the money received toward a new iPhone. Or buy a
    case in your preferred color for your current iPhone.
    If purchased from Apple US, return period is 14 days. I believe it is the same elsewhere,
    but check with your local Apple store. Be advised, that even if you are within the return
    period, returns are accepted only in the country of original purchase (EU is one country
    for this purpose).

  • Replacing comma with space

    Hi,
    Note : I am using SAP 4.6
    Task      : Replace Comma with space
    Problem : Not able to replace comma with space
    I have task where I have to write result file to application server, when I am writing string to application server it is separating by comma, for example if you take below statement it is dividing by space that means in first column PO and then ITEM etcu2026.
    MOVE  'PO ITEM is not there in table EKPO' TO W_RECORD_OUT-ERROR_MSG.
    so to resolve this situation I have used below code for now, I know I can use
    REPLACE ... ALL ENTRIES but this statement is not working in SAP 4.6
    REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
      REPLACE ',' WITH ' ' INTO W_RECORD_OUT-ERROR_MSG.
      CONDENSE W_RECORD_OUT-ERROR_MSG.
    appreciate if somebody can help me.
    Thanks
    sarath

    Hi,
    Please check the below code.
    REPORT  YSAT_TEST.
    Data: Var1(40) type c value 'Test1,Test2,Test3,Test4'.
    break-point.
    REPLACE ',' WITH space INTO Var1.                   " It will replace only first occurrence
    replace all occurrences of ',' in var1 with '   '.
    CONDENSE Var1 no-gaps.
    write: var1.

  • How to replace apostrophe with space

    Hi Experts,
    I need to replace the Apostrophe in Material description with space. I am getting a error as the text literal .....longer than 255.
    highly appreciated for immediate response.
    REPLACE ALL OCCURRENCES OF ''' IN WA_MAKTX WITH ''.
    thanks,
    RRR

    Hi Rammi,
    Hi have tried with the below code and I am getting the proper output as well.
    DATA wa_maktx(10) TYPE c.
    wa_maktx = 'as"dfg'.
    REPLACE ALL OCCURRENCES OF '"' IN WA_MAKTX WITH SPACE.
    write:/2 wa_maktx.
    output:
      asdfg
    Regards,
    Md Ziauddin.

  • Create outline on text with space problem

    I have been askd to make some buisnescard for a friend
    and he have chosen the font Cloister black http://www.dafont.com/cloister-black.font
    So i have set up the cards in ID (cs5) an trying to export them to pdf but gets the allert that the font cant be embede in the PDF so afte googling the problem i found out the outline part and hvae tryd to use that but keeps getting the alert when exporting to PDF.
    I then have tried to truble shot a litte and found out that it happens when i have a space in the text. I Have to write  (on a path) "Pub & Bar" on the cards with that font and if i remove thae spaceses the alert goes away.
    Is ther anny way to get around this problem ?? ( I know i can replaces the spaces with spaces frome another fonttype but is ther anny smarter way to get around this annoying problem )
    I can understand that ID cant outline a space but i almost see this problem as a bug ?

    This is the second time in a week that a problem embedding a Dieter Steffmann font has come up.
    For what it's worth, Herr Steffman does not license his fonts for commercial use, though many of them are digitized versions of old metal faces that don't have a large enough market for the foundries that made them (if even still in business) to release their own digital versions. That's not the case, however, with Cloister Black. There is a digital version from Bitstream with proper license provisions here: http://www.myfonts.com/fonts/bitstream/cloister-black/

  • Search .docx and replace text with image

    I've got a directory containing a series of images. The images will always be the same name and I need to insert them into placeholders in a Word document which will be a template. I thought of using the image names as placeholders, opening the document
    and searching for the image name, replacing it by inserting the image, and doing so for each image in the directory.
    $file is the name of the image in the directory and it loops through them okay.
    foreach($file in Get-ChildItem $savepath -Filter *.jpg)
            # search word doc and replace selected text with image ($file)    
    Also inserting the image seems simple enough from a TechNet article I found, but I've got no idea how to open the Word document and do a search and replace. I found a few articles related to the subject but I couldn't get them to work when I tried to adapt
    them.
    Any help is appreciated. Thanks in advance.

    This 'might' be possible, but I'm having a hard time finding good references to the com object capabilities for inserting an image into a word document.  Creating new, converting format, that sort of thing is straightforward.
    I'd do a search on "powershell word comobject" and variations of insert image update edit, etc.  Or maybe someone else with more experience/knowledge has a magic bullet for you.  Once you get some info on doing it with powershell, expand
    your search by omitting the powershell keyword, there's gotta be some solid documentation for the comobject somwhere, but it will probably be a bit complex.
    You can also:
    $word = new-object -comobject word.application
    $doc = $word.documents.add("<path to word document>"
    and get-member to your heart's content, but finding references and/or documentation might be easier.  
    Good luck!
    Edit:  This could help, but really doesn't give much insight into placement of the image, only helps getting the image into the doc:  http://gallery.technet.microsoft.com/office/44ffc6c8-131f-42f1-b24b-ff92230b2e0a
    If you do find something useful, post it here, I'm sure others could benefit!
    SubEdit:  Should have thought of this already...
    http://msdn.microsoft.com/en-us/library/ff837519(v=office.14).aspx

  • How to replace text with vector image in 3d space

    Hello,
    I want to replace the text in this template http://vimeo.com/15026094 with a vector image logo.
    Any ideas would be helpful. Btw, I have CS4.
    Thanks,
    td

    I finally took a look at your Vimeo example and I'd guess that the animation of the text was created with Text Animators and range selectors. As Mylenium said, and as I said
    Reveal all of the animated properties that you want to transfer to your new layer. Usually pressing the U key will suffice.
    Note: Text animations and shape animators will be ignored unless the new layer is a text or shape layer.
    You need read up on Text Animators so you can understand them.
    Type a question in the search field at the top right corner of After Effects.
    And you'll find all of these resources. (providing you have the Adobe Help preferences set to search the web)
    Animation presets will save all animated properties applied to a layer, but they will only apply the keyframes to properties that exist on the layer. Text Animators only exist in text layers so you'll have to animate your logo by hand or grab yourself a font creation tool and recreate your logo as a font.

  • Substitute Function in Excel: Replace text with instance number in BO

    Hi,
    I have a column where data is merged from three other columns each text separated by "-". Ex: Services - Phoneline - New Customer.
    What I wanted to do is to just get the last text which is "New Customer" separated. I used "Length(<columnValue>)-Length(Replace(<columnValue),"-",""))" to get the number of instances of "-" in the text as it varies from 1 to 3.
    I use to do it in excel using substitute function where I have the facillity to use the character instance number. I don't know how to do this in Business objects.
    Please help...
    Thanks

    DDann wrote:
    =SUMIF('New Req to Capability Mapping'!$D$2:$D$148,A2,'New Req to Capability Mapping'!$I$2:$I$148)
    Col A is a list of the capabilities and the formulas are in COL B of this sheet.  [....] The problem that I am experiencing is that for some of the capabilities I am see correct count totals for some while others are not for instance, "Account
    Management" shows correct while "Security Awareness Program" is not. I have copied the text for each of the capabilities from the main sheet into Col A to reduce keystroke errors. I have also copied those strings into some of the problematic
    formulas instead of using the cell address to see if the results change.
    Good troubleshooting techniques.  Unless someone gets lucky with a wild guess, I suspect we cannot help without having the workbook to see the situation for ourselves.
    You can upload an example Excel file (devoid of any private data) that demonstrates the problem to a file-sharing website.
    Then post the "shared", "public" or "view-only" link (aka URL; http://...) in a response here.
    The following is a list of some free file-sharing websites; or use your own.
    Box.Net: http://www.box.net/files
    Windows Live Skydrive: http://skydrive.live.com
    MediaFire: http://www.mediafire.com
    FileFactory: http://www.filefactory.com
    FileSavr: http://www.filesavr.com
    RapidShare: http://www.rapidshare.com
    I suspect that the problem has to do with either a mismatch in spacing or the presence of non-breaking spaces (HTML &nbsp) or other non-printing characters, notwithstanding your efforts to eliminate that possibility with your copy-and-paste experiments.

  • Replace text with formula in calculate columns

    How can I replace ";" in a text like this with " AND " ?
    example text: "abc;cde;efg;ijk"
    the result should be like this: "abc AND cde AND efg AND ijk"

    Hi,
    According to your description, my understanding is that you want to replace “;” with “AND” in calculated column.
    As you are not using English as the default language, you should use the localized version of function names and ";" instead of commas.
    To replace all the “;” with “AND”, we need to use the formula as below(for English site):
    =REPLACE((REPLACE((REPLACE([mycolumn],SEARCH(";",[mycolumn]),"1"," AND ")),SEARCH(";",(REPLACE([mycolumn],SEARCH(";",[mycolumn]),"1"," AND "))),"1",
    " AND ")),SEARCH(";",(REPLACE((REPLACE([mycolumn],SEARCH(";",[mycolumn]),"1"," AND ")),SEARCH(";",(REPLACE([mycolumn],SEARCH(";",[mycolumn]),"1"," And "))),"1",
    " AND "))),"1"," AND ")
    More references:
    http://sharepoint.stackexchange.com/questions/59195/modifying-a-calculated-column-gives-different-errors
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/5487889f-5fc8-48e1-8ea2-28f8c9c8ad0c/calculated-field-error?forum=sharepointgenerallegacy
    http://office.microsoft.com/en-in/windows-sharepoint-services-help/replace-function-HA001161055.aspx
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Replace text with image using Applescript in InDesign CS5

    Hi to everyone, i'm looking for some suggestions to resolve my problem.
    I've to replace some strings with jpeg images stored on my pc
    Here is the code to replace two strings with the new ones.
    tell application "Adobe InDesign CS5"
              set myDocument to active document
              set myPage to page 1 of myDocument
              set stringsToReplace to {"111", "222"}
      repeat with iterator from 1 to (count stringsToReplace)
           set find text preferences to nothing
           set change text preferences to nothing
           set myFoundItems to nothing
           set element to item iterator of stringsToReplace
          if element is "111" then
               set find what of find text preferences to "111"
               set change to of change text preferences to "ONE"
               set myFoundItems to change text
               display dialog ("Found : " & (count myFoundItems) & " occurences of " & element)
          else if element is "222" then
               set find what of find text preferences to "222"
               set change to of change text preferences to "TWO"
               set myFoundItems to change text
               display dialog ("Found : " & (count myFoundItems) & " occurences of " & element)
          end if
              end repeat
      set find text preferences to nothing
      set change text preferences to nothing
    end tell
    Can you hel me?
    Thanks in advance.

    Hello, I have a couple of questions for you… How come you have strings in text frames… Would you not be better off using labels for this…? ( thats how I would do this ). Off the top of my head I think you will need to remove any text content from the frame to be able to change it's content type… only then will you be able to place a graphic… How are you associating your strings with the required image files… Do you have this in some extenal file Excel or FMP.

  • Replace text with number

    Hi
    i have 2 columns from flat file
    0amount       number
    10000          
    "Intangibles"         2000
    20000              
    'sales'         4000
    my output is required like
    incase if i am getting text ( this text is not constant its coming like any thing shownw above example)  i need replace number key figure values in 0amount fileds.
    how can i reach with this in field routine
    data v_text type char
    if source_fields_0amount not equall number
    result 0 number ( kf)
    like what is code i need to use

    Hi,
    One thing's to be clarified :
    If you need sometimes number & sometimes text in a particular target field, then it has to be a char field and you cant do any mathematical operation on that later.
    --Akashdeep

Maybe you are looking for

  • Restore database failed on Oracle 10g 10.2.0.1 linux 32 bit

    Hi, I am working on test database for testing database disaster recovery. 1) i made full database backup by RMAN and ui also have archive log 2) i noted DBID and all folders of database 3)Turn on the Controlfile auto backup 4) then i drop database 5)

  • Build a New Libary vs. Add Files?

    I need advice about the choice creating a new library file or adding files to the library. Here is the situation: My computer was stolen .  On the computer that was stolen I had I-Tunes installed.  The music/media files were on an external hard drive

  • Picklist questions - Web Services

    We would like to get the valid values of certain picklists and move them (refresh daily for instance) to our MySQL DB to validate prior to inserting in CRMOD. 1) Can we get only valid values when we do our WS call? If so, how and can it be done using

  • Portal & business Role updation

    Hi Gurus, here i have created and assigned transaction launcher and logical links under navigation bar profile for "Zsalespro" role and it is working fine in webui. but myclient is using portal. so question is "do i need to do any additional setting

  • Mat**bleep**a UJ-852 issues

    I've seen a number of topics of people having disc read issues with the Mat**bleep**a UJ-852 drive and I'm curious if there was ever a firmware update or resolution for the issue. My drive intermittently reads some cd's and not others, with no rhyme