in reply to How to repeat a string multiple times if found match
>perl -pibak -e"$_ = qq(foo_1\nfoo_2\nfoo_3\nfoo_4\n) if /^foo_$/" xx. +txt >dir xx.txt* Volume in drive C is Windows Volume Serial Number is AE03-D45F Directory of C:\Users\Bill\forums\monks 03/09/2021 10:47 PM 57 xx.txt 03/09/2021 07:04 PM 35 xx.txtbak 2 File(s) 92 bytes 0 Dir(s) 379,932,401,664 bytes free >type xx.txt hello world foo_1 foo_2 foo_3 foo_4 foo abc
|
|---|