How To Delete Lines Using PERL Edit In Place

Using PERL, we can easily do a search and replace across multiple files. perl -ni -w -e ‘print unless m/^gdb\d+/;’ yourFileSpec
![]() |
Using PERL, we can easily do a search and replace across multiple files. perl -ni -w -e ‘print unless m/^gdb\d+/;’ yourFileSpec
Using PERL, we can easily do a search and replace across multiple files. perl -pi -w -e ‘s/SEARCH_FOR/REPLACE_WITH/g;’ FILE_LIST The following example will replace all occurrences of “hello” with “goodbye” inside files ending with .txt:
1 |
perl -pi -w -e 's/hello/goodbye/g;' *.txt |
To handle special characters, use the hex value. For example, to convert MS web files that use control characters: […]
I used the ImageMagick mogrify command to batch-create over 14,000 thumbnails easily. Since the default operation is to overwrite the originals, I chose to write the output files into a different directory with the -path option. Note the greater-than sign (>) after the 100×100 dimensions. This flag tells mogrify to only shrink images that have […]
Many thanks to Robert Russell for his excellent conversion tip! I have recorded the procedure below in case that post ever goes away… Download the two required installation packages from Microsoft: Microsoft Office Migration Planning Manager Microsoft Office Compatibility Pack for Word, Excel, and PowerPoint File Formats Install both packages. Specify a place to install […]
YMMV…
1 2 |
mysql --batch -u root -p -e "create database yourDataBaseBackup; SELECT CONCAT('RENAME TABLE ',table_schema,'.',table_name,' TO ','yourDataBaseBackup.',table_name,';') FROM information_schema.TABLES WHERE table_schema LIKE 'yourDataBase';" > backup.sql mysql -u root -p < backup.sql |