UKhombre has asked for the wisdom of the Perl Monks concerning the following question:
The person who helped me came up with the command perl -pi -e 's/\S/\-/g'
With a crash course in using BB Edit and Terminal for the mac I've managed to use it. The only problem is the code turns commas, full stops, colons, and semi-colons into hyphens. I want to use it so students can write down the Spanish they are listening to over the hyphens and if the hyphens include punctuation marks this will confuse people. It didn't occur to me this problem beforehand unfortunately.
Is it possible to come up with an amended command that would covert only words into hyphens and spaces and leave the punctuation intact? I don’t know if this is an impossible task to ask for or is simple to do. I would be delighted if someone could come up with it. Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Converting a passage of Spanish into hyphens and spaces
by Corion (Patriarch) on Sep 13, 2015 at 10:52 UTC | |
by UKhombre (Initiate) on Sep 13, 2015 at 12:44 UTC | |
by Corion (Patriarch) on Sep 13, 2015 at 12:46 UTC | |
by UKhombre (Initiate) on Sep 13, 2015 at 13:50 UTC | |
by shmem (Chancellor) on Sep 13, 2015 at 15:23 UTC | |
| |
by hippo (Archbishop) on Sep 13, 2015 at 15:28 UTC | |
|