How to delete lines of file without changind date?
Posted: 19 Mar 2024 12:31
No, this is not possible. But there is a workaroud:
The other option, I see the answer from this question. This is the command:
Now, how can I change the last modified date of the output.txt file to be equal to input.txt?
After this, just delete and rename the new file.
So, how can I edit a file inplace or how can I copy the last mofified date of one file to another only using cmd.exe? Is this possible?
- You edit the file
- Then you change the date
- Can I edit the file inplace?
- If YES, I need to store the date in memory an then change it
- If NO, I need create a new file, toch it, delete the old and rename the new one
The other option, I see the answer from this question. This is the command:
Code: Select all
type input.txt | findstr /v ERROR | findstr /v REFERENCE > output.txt
After this, just delete and rename the new file.
So, how can I edit a file inplace or how can I copy the last mofified date of one file to another only using cmd.exe? Is this possible?