Results 1 to 3 of 3

Thread: Vbscript find replace help

  1. #1
    Join Date
    Jun 2009
    Posts
    2

    Vbscript find replace help

    Hello,

    Im trying to crack something. I have a result file, that I want to edit. I want to delete the |001 string.

    The tricky thing is: I want to delete the |001 from every DATE|LOCATION1|001 line, but not the 001 from the BARCODE1|001

    The DATE|LOCATION1|001 middle section (location) changes all the time. So i can't find a unique string to find and replace.. Is this doable with vbscript?

    ABC|ABC|***
    DATE|LOCATION1|001
    BARCODE1|001
    ABC|ABC|***
    DATE|LOCATION2|001
    BARCODE2|001
    [ETC..]

  2. #2
    Join Date
    Dec 2007
    Posts
    1,547

    Re: Vbscript find replace help

    Is this what you are asking for.
    YOURSTRING= Replace(YOURSTRING, "-", "")

  3. #3
    Join Date
    May 2008
    Posts
    685

    Re: Vbscript find replace help

    Why don't you try something like first accept the string in a variable, then compare it with "DATE|LOCATION" string and if found replace the last part with blank otherwise move ahead for the next string. I hope you get my point.

Similar Threads

  1. Find / Replace in Excel 2007
    By KALANI84 in forum Windows Software
    Replies: 4
    Last Post: 21-03-2012, 01:32 AM
  2. How to find replace text in Excel
    By Chini mao in forum Windows Software
    Replies: 3
    Last Post: 07-01-2012, 11:44 AM
  3. Find and Replace in JavaScript String
    By Wilbur in forum Software Development
    Replies: 5
    Last Post: 15-12-2009, 02:23 PM
  4. Vbscript to find latest file
    By BoanHed in forum Software Development
    Replies: 3
    Last Post: 23-11-2009, 08:38 AM
  5. SQL find and replace query
    By Seraphim in forum Software Development
    Replies: 3
    Last Post: 26-05-2009, 01:40 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,441,171.83266 seconds with 17 queries