Batch - edit specified line in text file
问题 For example, line number 2 reads: "0" (without quotes). I want to change that 0 to a 1, without changing anything else in the text file. I know what line the values will be on, so all i need to know is how to change that value to another value that I specify. I also will have to to the same with strings, not just numbers. Example: From: 4.7 0 check 0 1 0 0 To: 4.7 1 check 0 1 0 0 Thanks! 回答1: try this: @ECHO OFF &SETLOCAL SET "file=file" SET /a Line#ToSearch=2 SET "Replacement=0" (FOR /f