Search found 18 matches

by paolo2504
15 Mar 2022 02:08
Forum: DOS Batch Forum
Topic: Variable vs arguments containing special chars
Replies: 4
Views: 6172

Re: Variable vs arguments containing special chars

One more time, appreciate your great help. Regarding the past issue and this present one there are two ways to declare bars: a) var search str = “\\.\\/“+ “\\.\\\\” +, “\\=\\\\”; var re = eval(“/“+str+”/gì”) b) var re = /\.\/|\.\\|\=\\/gi The method .replace works in both cases. Regards.
by paolo2504
12 Mar 2022 12:30
Forum: DOS Batch Forum
Topic: Variable vs arguments containing special chars
Replies: 4
Views: 6172

Variable vs arguments containing special chars

Hi all. I'm just beginner with ms/jscript (jscript under Windows). I recently faced an issue that i can't understand: i found that variable containing special characters are treated in a different way when passed as arguments from a batch file or set directly inside the jscript code. I wrote a brief...
by paolo2504
11 Mar 2022 12:45
Forum: DOS Batch Forum
Topic: Conditionally replace slash with jrepl.bat
Replies: 13
Views: 13585

Re: Conditionally replace slash with jrepl.bat

I have been told that object.keys is not supported in ma/jscript. This explains why I am getting method / property error.

Il search some other solutions.

This said, I think this post can be closed.
Many thanks to AAcini.
by paolo2504
11 Mar 2022 12:35
Forum: DOS Batch Forum
Topic: Replace multiple string and regexp
Replies: 2
Views: 5114

Re: Replace multiple string and regexp

I got this suspect…. Many thanks : I’ll study nodejs.
by paolo2504
11 Mar 2022 02:38
Forum: DOS Batch Forum
Topic: Conditionally replace slash with jrepl.bat
Replies: 13
Views: 13585

Re: Conditionally replace slash with jrepl.bat

Sorry it was an error. The intention was to re- edit my post, not to quote myself.
by paolo2504
10 Mar 2022 16:30
Forum: DOS Batch Forum
Topic: Conditionally replace slash with jrepl.bat
Replies: 13
Views: 13585

Re: Conditionally replace slash with jrepl.bat

Antonio, foa i do appreciate your help. I also understand your words about reading first post (done!) and what to do writing post. I'll try to do my best. First of all a quick explanation of what i'm doing. A free Organ virtual simulator named GrandOrgue is able to use samplesets of real organs aro...
by paolo2504
10 Mar 2022 14:45
Forum: DOS Batch Forum
Topic: Conditionally replace slash with jrepl.bat
Replies: 13
Views: 13585

Re: Conditionally replace slash with jrepl.bat

Antonio, foa i do appreciate your help. I also understand your words about reading first post (done!) and what to do writing post. I'll try to do my best. First of all a quick explanation of what i'm doing. A free Organ virtual simulator named GrandOrgue is able to use samplesets of real organs arou...
by paolo2504
09 Mar 2022 11:28
Forum: DOS Batch Forum
Topic: Replace multiple string and regexp
Replies: 2
Views: 5114

Replace multiple string and regexp

On another jscript forum i found the following sample code that helps me greatly on a problem i have posted on this forum. However, running this piece of code i am getting error: microsoft jscript runtime error property or method not supported by object. Error arises on line with RegExp. I don't und...
by paolo2504
08 Mar 2022 16:41
Forum: DOS Batch Forum
Topic: Conditionally replace slash with jrepl.bat
Replies: 13
Views: 13585

Re: Conditionally replace slash with jrepl.bat

hi Aacini, i need your kind help. I am trying to use your code to avoid calling jrepl.bat. Your code works but now i need to do the string replacements using variable strings passed from the batch portion. The code below is your code modified. I see parameters are passed to the jscript portion but ...
by paolo2504
08 Mar 2022 12:47
Forum: DOS Batch Forum
Topic: Conditionally replace slash with jrepl.bat
Replies: 13
Views: 13585

Re: Conditionally replace slash with jrepl.bat

hi Aacini, i need your kind help. I am trying to use your code to avoid calling jrepl.bat. Your code works but now i need to do the string replacements using variable strings passed from the batch portion. The code below is your code modified. I see parameters are passed to the jscript portion but ...
by paolo2504
01 Mar 2022 11:53
Forum: DOS Batch Forum
Topic: Conditionally replace slash with jrepl.bat
Replies: 13
Views: 13585

Re: Conditionally replace slash with jrepl.bat

i do appreciate your support. just a couple of questions: your code writes changes to stdout (screen). How to write changes to the input file (or to a new file) ? note: i tried this @set @a=0 // & cscript //nologo //E:JScript "%~F0" < d:\kalvtrask.organ > d:\kalvtrasknew.txt & goto :EOF it works and...
by paolo2504
28 Feb 2022 03:54
Forum: DOS Batch Forum
Topic: Conditionally replace slash with jrepl.bat
Replies: 13
Views: 13585

Re: Conditionally replace slash with jrepl.bat

I tried anyway the code you so gently posted here and it doesnt work (it doesnt read lines and %%a contains the filename). This ways it does; however, as said before, it is very very slow compared with jrepl. @echo off setlocal EnableDelayedExpansion set changeExt=".png" for /f "usebackq tokens=*" %...
by paolo2504
28 Feb 2022 01:59
Forum: DOS Batch Forum
Topic: Conditionally replace slash with jrepl.bat
Replies: 13
Views: 13585

Re: Conditionally replace slash with jrepl.bat

Thanks aAcini for reply. Yes, I use jrepl because it is much faster than any piece of code I wrote. Anyway, I should explain better. Actually, I have to replace multi strings in a file: let’s say 2-3 strings for every line and a fourth one only if line itself ends with (just an example) .wav With jr...
by paolo2504
27 Feb 2022 17:21
Forum: DOS Batch Forum
Topic: Conditionally replace slash with jrepl.bat
Replies: 13
Views: 13585

Conditionally replace slash with jrepl.bat

With jrepl.bat i am trying to do as follow. I need to change all slash to backslash in every lines in a .ini text file only when some conditions are met. example key0=http://www.websiteinfo.com/somepage/someindex.html key1=image/a0/a123.wav key2=images/a0/a1234.wav key3=./images/a0/a1234.wav key4=ne...