I want to delete text from multiple files. It could be from 10 to 1000 files, so deleting it by hand is too much work.
I found a couple of SO questions, such as:
Delete specific lines in multiple Text Files with freeware App? but none of them helped
To do find and replace, I could write a perl command, but it lacks options.
For example, I want to delete the first four lines in all files.
Does anyone know a solution? Or maybe an app? I would prefer something without VBScript.
sed(1)orawk(1)would be great for this job. For example, to delete the first 4 lines of all of the.txtfiles in the current directory:This will delete the first 4 lines of all
.txtfiles anywhere in a subdirectory of the current directory: