8/25/2023 0 Comments Dcommand line remove window"%USERPROFILE%\Desktop\tt\t.txt" >.\t.txtįor /f "delims= " %T in ('robocopy /L. means any character, also space, tabs.Ĥ) if your file have lines with only tabs in there? The lines blank is not 100% blank, so, these lines are saving to file output too!ĥ) Considering use a t.tmp file to do this job.Ħ) My suggest to you is use the code for bat in last lines code here, just copy these lines and save as file.cmd, the bat will remove all tabs in any line blank or not. that make your command became look like this layout:įindstr "." c:\Users\Elisha Habinsky\Desktop\tt\t.txt c:\Users\Elisha Habinsky\Desktop\tt\t.txtġ) Use quote in "%USERPROFILE%\Desktop\tt\t.txt" and %USERPROFILE%\Desktop\tt\t.txt" > t.txtĢ) Don't need to use quote in regex : ".In fact, this command above can do this job, but, I'm considering that this not work, and IĪlso suppose that your user name have space (" compound name" = " Elisha Habinsky") findstr "." %USERPROFILE%\Desktop\tt\t.txt %USERPROFILE%\Desktop\tt\t.txt > t.txt.Whereas this will add useless information:.Wow look at this weird characters ÎøÎñÎ['\Desktop\tt\t.txt' -Raw) -replace "(?m)^\s*`r`n",'').trim() | Set-Content. > t2.txt will copy all output to a new file (efectively concatenating all lines into one since all newline characters were removed, as OP asked)./p="%i" will echo the line without a new line ( source).will process the txt file line by line, %i being the whole line.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |