|
Posted by wcb on 06/18/05 16:25
David Dorward wrote:
> wcb wrote:
>
>> I am looking for some sort of little Linux utility
>> where I could insert <br>'s into an existing file.
>
>> Is there such a quick and dirty beastie for Linux?
>
> perl -i.bak -p -n -e 's/\n/<br>\n/' myTextFile
>
OK, this didn't quite work.
I rewrote it perl -p -e 's/\n/<br>\n/' myfile > myfile.br
Which does. It slaps <br> like I wanted and pipes it to
a new file with a .br on the end of the file's name.
But if I try * > *.br in a directory with numerous files,
it does not work, perl does not understand *. What's the
magic tickle for perl here that would allow a batch process?
What does perl use instead of "*" ? "Learning Perl" does not
have wild card in the index.
--
When I shake my killfile, I can hear them buzzing!
Cheerful Charlie
Navigation:
[Reply to this message]
|