-1

I have a code that needs gui or else it would be realy hard to edit the code by hand every time i use it . I have the gui but theres a little problem

I have txt file wheres the code what i need to edit and its on 103 line. I tried to echo all the text and where i needed to edit some numbers use %numbers% But it would come out supper messy and broken . So i need some way to edit the line where i need to change some numbers . something like this .

edit C:/users/%username%/desktop/folder/textfile.txt line103 echo bla bla bal 123123131

Basicly i need to echo some text to 103 line in text file ! I guess you understand what i want to do . Is there anyway to do that ?

Edit!

Is there find and replace script maybe ? IT would help alot if i can call the file like this findandreplace.vbs findthisword andreplacewiththis If there is something like this i would be so happy as hell because otherwise i would need to echo every time a file what has for the replace word %this% and then run it .

Heres the compact version of my question ! I need a script what i can call like this vbscript.exe filename.vbs (thewordiwanttofindandreplace) (thereplaceword)

nofthing else . Is there anything like that ?

Edit Im sorry that i didnt make myself clear .(bad english)

I need a scritp\bat\vbs\command what when called it will type text in specific line or replace a word .

I have a bat that will ask person to insert the url where it will download and the files extension it will download. Now i want to edit that information to the downloader bat file what i have already working . Like this Set downloadlink= "here i want the url the person inserted Set downloadlinkextension= " here i want the files extension what person inserted.

Now i just want these 2 lines To be edited. Is there way to replace lines in txt files or find and replace. Like this Itl find word replacethis and replace it with users enterd url

Set downloadlink=replacethis Itl replace the "replacethis" with users inserted download link I am sorry there may be misspelling because im typyng from tablet

Is there anything like that?

3
  • There are about half a dozen ways to do these things in *nix. Can you install and use Cygwin? Sep 21, 2015 at 0:02
  • You started with a batch script to echo/append a text to line 103 & ended with a vbscript to find and replace....define you requirements properly and ask it again. There are ways to do both of them
    – clhy
    Sep 21, 2015 at 2:59
  • If it's only for one file, you can do it with notepad or any text editor that support regex if it's more complex
    – Paul
    Sep 21, 2015 at 7:39

1 Answer 1

0

There is a hybrid script called JREPL that can help you to search replace from batch

USAGE:

JREPL  Search  Replace  [/Option  [Value]]...
JREPL  /?[REGEX|REPLACE|VERSION]
JREPL  /??

I can't past the script here because too long. So I post a gist and the source link of the author.

Author's post, Gist, Gist RAW

1
  • ECho txt>txt.txt
    – Roke
    Nov 2, 2015 at 20:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .