|
Answer» Hi,
I wish to writea BAT file which able to get a string from one file. For example, I have a file named :helloworld.cpp. I wish to get a string "SingTel" in the helloworld.cpp file. How can I do tat? Any dos command ALLOW me to do so...
Million thanks in advance.
Regards,
Adrianyes U can
find "SingTel" filepath/helloworld.cpp Hi,
Thanks for your reply, I knew there is a "find" command. however, what i wish to do is to "get" the string and replace it somewhere else. For example, I need to get the "Singtel" string and replace it into another file.
Besides, what if my string is get from combobox? Can the DOS command retrieve that? For example, the string i get is as below:
Code: [Select]String^temp=comboBox1->SelectedItem->ToString();
So what DOS command can I use to retrieve the string "temp" and replace it into another file?
Million thanks.it will depend on whether the word "SingTel" is constant word in your file, or whether its unknown at the time of "getting it" If its constant, you can use find as demonstrated and if its found, you can be sure the word Singtel is there. If its unknown, then its a different story, as you need to know where it appears. Show a sample of your helloworld.cpp file.Hi,
Thanks for your reply, if the string "Singtel" is constant word then how can I use "find" command to get the string? I mean get the string" Singtel" and put it into another file. I tried the "find" function, it only find out the requested string in the file, my QUESTION is how to get the string and put it into another file.
For example, if there is a string "Singtel" (constant word) in helloworld.cpp, how can i get the string and put it into test.txt?
Thanks in advance.if the constant "Singtel" is in the file and the find command found it, then proceed on to the file you want to manipulate and insert "Singtel" into it. Hi,
i m a newbie in MS-DOS, can anyone give me an example on how to insert the string i found into a file? For example, I found a string "Singtel" and how can I insert the the string into line 2 of file hello.cpp.
Million thanks in advance.
|