1.

Solve : replace substring when giving file name to print?

Answer»

Hello,

i WANT to execute the following command

LPR -S 192.168.3.20 -P AUTO d:\SAMPLE.txt

replacing in the filename the word sample with the word test.
I mean the real file that i want to print is test.txt

How can i do this from DOS? Is there any function that can be used to replace the word sample with the word test?What do you mean??
Quote from: alex1982 on October 10, 2008, 07:43:19 AM

i want to execute the following command

LPR -S 192.168.3.20 -P AUTO d:\sample.txt

replacing in the filename the word sample with the word test.
I mean the real file that i want to print is test.txt

If you want to do it at the prompt, why can't you just type this?

Code: [Select]LPR -S 192.168.3.20 -P AUTO d:\test.txt
Or if the command is in a batch file, why can't you load it in Notepad, change "sample" to "text" by use of the delete key and a bit of typing, and then save the batch file?

I fully EXPECT your answer will be that it's not as simple as that, but since you have given no background information, I don't SEE what else can be suggested.


Discussion

No Comment Found