致论坛的老师&大神:
请教关于bat批处理,有两个地方的空格导致不知该如何解决,1,待处理的文件名或其存放路径名含有空格,2.需要替换文件里边内容,该内容是带有空格的字符串。搜变全网没找到都满足的解决方案。
比方说有一个txt文档,他的文件名是: address update.txt,文件名或其存放路径名含有空格,
要替换的内容为: 000- woodlands drive 79,想将文本内所有的该字符串替换为 000- sembawang street 66
address update.txt文本内容如下:- Update = Open( Concat( New_path, "000- woodlands drive 79.csv" ) );
-
- Update << select where( :RAW_VALUE == 0 );
- Update << Delete Rows;
-
- Update << New Column( "Batch",
- Character,
- Nominal,
- Formula(
- If(
- Contains( :ID, "ID001" ), "001",
- Contains( :ID, "ID002" ), "002",
- )
- )
- );
-
- Update << Move Selected Columns({“Batch”}, To First);
-
- Column( Update, "shift ID" ) << data type( Character );
- Column( Update, "shift ID" ) << Set Modeling Type( Nominal );
- Column( Update, "shift ID" ) << set name( "Batch ID" );
-
- For Each Row(
- Update,
- :Batch ID = Match( :Batch ID,
- "9653856", "shift1",
- "9673409", "shift2",
- "9653427", "shift1",
- "9663511", "shift2",
- "9653427", "shift1",
- "9663550", "shift2",
- "Unspecified"
- )
- );
-
- Update << New Column( "rename",
- Character,
- Nominal,
- Formula(
- If(
- Contains( :address, "param1" ), "000- woodlands drive 79",
- Contains( :address, "param2" ), "000- woodlands drive 79",
- Contains( :address, "param3" ), "000- woodlands drive 79",
- Contains( :address, "param4" ), "000- woodlands drive 79",
- Contains( :address, "param5" ), "000- woodlands drive 79",
- Contains( :address, "param6" ), "000- woodlands drive 79",
- )
- )
- );
-
- dtWaferLevel = Update << Split(
- Split By( :rename ),
- Split( :RAW_VALUE ),
- Group(
- :Batch,
- :Category,
- :LOT_ID,
- :Batch ID,
- ),
- Remaining Columns( Drop All )
- );
复制代码
|