I have text files which I want to remove the first 9 lines from.
I have not been able to work out the syntax. Using Windows, so need to remove the CRLF characters also.
Alternative solution possible, as line 10 always begins with the word "Region" (without quotes),
so a solution which removes everything prior to this text would also be suitable.
Thanks for any answers!
Delete x lines, then stop
- DigitalVolcano
- Site Admin
- Posts: 1863
- Joined: Thu Jun 09, 2011 10:04 am
Re: Delete x lines, then stop
You can try
Regex:
Replace:
$1
With 'dot maches newline' checked.
This should work if you don't have later lines with 'region' in the file, otherwise you may lose more data. Always test and back up first!
Regex:
Code: Select all
.*?(region)
$1
With 'dot maches newline' checked.
This should work if you don't have later lines with 'region' in the file, otherwise you may lose more data. Always test and back up first!
Re: Delete x lines, then stop
see https://forum.sublimetext.com/t/regex-m ... mpty/20850
This will delete the first 10 lines.
(\s*^(\h*\S.*)){10}
This will delete the first 10 lines.
(\s*^(\h*\S.*)){10}
Re: Delete x lines, then stop
Thanks Suzy.
In the end I went with a compiled AutoIt script to process all the files in a folder.
In the end I went with a compiled AutoIt script to process all the files in a folder.
Re: Delete x lines, then stop
it is good this Autoit software?
Re: Delete x lines, then stop
It is good for me. I use it to automate several tasks in my job. It isn't a full programming language though.
AutoIt is typically used to produce utility software for Windows and to automate routine tasks, such as systems management, monitoring, maintenance, or software installation. It is also used to simulate user interaction, whereby an application is "driven" (via automated form entry, keypresses, mouse clicks, and so on).
https://en.wikipedia.org/wiki/AutoIt
AutoIt is typically used to produce utility software for Windows and to automate routine tasks, such as systems management, monitoring, maintenance, or software installation. It is also used to simulate user interaction, whereby an application is "driven" (via automated form entry, keypresses, mouse clicks, and so on).
https://en.wikipedia.org/wiki/AutoIt