+ Reply to Thread
Results 1 to 3 of 3

Thread: Help with search/replace

  1. #1

    Smile Help with search/replace

    I have a variety of comma delimited text files where I need to search for a specific string within certain columns (35 - 41) & if I find the string, I need to replace it with another value. Presently I create a block which contains all the lines (records) and use the search/replace function. However, I have to hit enter to go thru every line (record) in the file. I was hoping since I had defined a block for the search/replace, I would execute the search/replace and it would replace the all the values if the string matched.

    As an example if the value in columns 35 - 41 contain the string ABCD, I would like to change the string to Newtxt. The string is case sensitive. I suspect I am missing something & would appreciate any help.

    Thanks in advance.

  2. #2
    Not sure how to do this in VEDIT, but you could use VEDIT in conjunction with MacroExpress and have the macro express program hit the "enter" for you over and over. Between each "enter", before it is executed, the macro should check for the existence of the VEDIT "Cannot Find" dialog box. If it is not there, you continue, if it is, you abort the macro.

    The "Cannot Find" box should only come up when all replacements have been made:
    cannot find.JPG

    The Macro Express program (if you use that one) will recognize that dialog box as one named simply "VEDIT" and that is good enough. There should be no other dialog box appear with that name unless all the replacements have been made, or, some other error occurs, which means you want the macro to abort anyways....

    If you use regular expressions, I think there may be a way to count character positions in a line.

    Or, you might explore PERL for this, as another option....
    folioite
    VEDIT 6.24.2, Win 10/64 Pro
    Using VEDIT daily, since 1987...

  3. #3
    Senior Member
    Join Date
    Nov 2014
    Location
    Minneapolis, MN
    Posts
    317
    Hi foliote,

    Thanks for the informative answer.

    -peter

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts