Topic: Command line execution (1 of 5), Read 91 times
Conf: Hex, Binary, EBCDIC
From: Steven Berkowitz
Date: Tuesday, September 14, 2004 05:36 PM

Sorry for my novice use and questions of VEDIT.
There is a find replace option using hex strings, How would I invoke vedit using a macro to convert all hex '00' to hex '20' close and save the file. basically I just want to convert all nulls to spaces.

 


Topic: Command line execution (2 of 5), Read 90 times
Conf: Hex, Binary, EBCDIC
From: Ian Binnie
Date: Tuesday, September 14, 2004 07:58 PM

On 9/14/2004 5:36:27 PM, Steven Berkowitz wrote:
>Sorry for my novice use and
>questions of VEDIT.
>There is a find replace option
>using hex strings, How would I
>invoke vedit using a macro to
>convert all hex '00' to hex
>'20' close and save the file.
>basically I just want to
>convert all nulls to spaces.

There is no need to use hex.
The following command would do what you want.

Replace("|000"," ",BEGIN|ALL|NOERR) // replace nulls by spaces

You could save this into a file to run as a macro, but I wouldn't bother. It would take longer to find & execute than to type into the Vedit Search & Replace dialog.

If you do this often, it may be better to include this in the Tools or User MENU.

Look at the user.mnu file to see how this works.
(And of course read the documentation to discover how the funny numbers work.)

 


Topic: Command line execution (3 of 5), Read 91 times
Conf: Hex, Binary, EBCDIC
From: Ian Binnie
Date: Tuesday, September 14, 2004 08:04 PM

On 9/14/2004 7:58:49 PM, Ian Binnie wrote:
>On 9/14/2004 5:36:27 PM, Steven
>Berkowitz wrote:
>>Sorry for my novice use and
>>questions of VEDIT.
>>There is a find replace option
>>using hex strings, How would I
>>invoke vedit using a macro to
>>convert all hex '00' to hex
>>'20' close and save the file.
>>basically I just want to
>>convert all nulls to spaces.
>
>There is no need to use hex.
>The following command would do what you
>want.
>
>Replace("|000"," ",BEGIN|ALL|NOERR) //
>replace nulls by spaces
>
>You could save this into a file to run
>as a macro, but I wouldn't bother. It
>would take longer to find & execute than
>to type into the Vedit Search & Replace
>dialog.
>
>If you do this often, it may be better
>to include this in the Tools or User
>MENU.
>
>Look at the user.mnu file to see how
>this works.
>(And of course read the documentation to
>discover how the funny numbers work.)
>

PS if you want to automatically close the file include:-
File_Close(NOMSG)

I think this answers your question, if not specify in more detail what you want to do e.g. did you want to open & close Vedit; run from a batch file etc.

 


Topic: Command line execution (4 of 5), Read 88 times
Conf: Hex, Binary, EBCDIC
From: Steven Berkowitz
Date: Monday, September 20, 2004 05:12 PM

Hello Ian,

What you said in your note is exactly correct. I want to run this task in/from a batch file. I want to open the file, replaces nulls with spaces, and close the file.

If you can show me how to do that it would be of the greatest help.

Thanks in advance for your cooperation.

 


Topic: Command line execution (5 of 5), Read 96 times
Conf: Hex, Binary, EBCDIC
From: Ian Binnie
Date: Monday, September 20, 2004 09:03 PM

On 9/20/2004 5:12:32 PM, Steven Berkowitz wrote:
>Hello Ian,
>
>What you said in your note is
>exactly correct. I want to
>run this task in/from a batch
>file. I want to open the
>file, replaces nulls with
>spaces, and close the file.
>
>If you can show me how to do
>that it would be of the
>greatest help.
>
>Thanks in advance for your
>cooperation.



There are a couple of ways to do this.

The most general, and easiest is to first create and debug a macro, saving into a file in C:\vedit\user-mac\

In this case this consists of only a single line:-

Replace("|000"," ",BEGIN|ALL|NOERR) // replace nulls by spaces


Then create a batch file which calls this macro

c:\vedit\vpw -q -s2 -x Null2Space.vdm %1


To understand what all the switches do search for "Starting (Invoking) VEDIT" in the help file.



The other way to do this is to include the commands in the batch file.
This is the way I would do this for such a simple task, but it is a little harder to debug, and you need to be careful with strings.

C:\vedit\vpw.exe -q -s2 -c"Replace('|000',' ',BEGIN|ALL|NOERR)" %1


Note the preceding is a single line.