简体   繁体   English

如何将双引号作为参数传递给批处理文件

[英]how to pass double quote as a parameter to a batch file

I am having a repl.bat file which replaces a string1 by another string2. 我有一个repl.bat文件,它将另一个字符串2替换为字符串1。 its syntax is like this 它的语法是这样的

type input.csv |repl "String1" "String2" > ouput1.csv 输入input.csv | repl“ String1”“ String2”> ouput1.csv

I want to replace Double Quotes by space and write data into output.csv file 我想用空格替换双引号并将数据写入output.csv文件

I have tried like this... 我已经尝试过了

     type input.csv |repl """ " "  >  ouput1.csv

it is throwing an error " The process tried to write to a nonexistent pipe. 它将引发错误“该进程试图写入不存在的管道。

What to do??? 该怎么办??? plz help...... 请帮助...

type input.csv | repl "\x22" " " X >  ouput1.csv
type input.csv | repl "\q"   " " X >  ouput1.csv

You need to use the extended substitution pattern syntax ( X switch) and use \\x22 to indicate the double quote character hexadecimal ASCII code, or \\q to indicate a quote (double quote). 您需要使用扩展的替换模式语法X开关),并使用\\x22表示双引号字符的十六进制ASCII代码,或使用\\q表示引号(双引号)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM