imhacked has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I am trying to replace all numerics to words in a very large txt file. Example as follows Sentence : I am going to 44 avenue. Result : I am going to forty four avenue. I have written as follows :
use Lingua::EN::Numbers qw(num2en num2en_ordinal); if(isdigit (\w) s/(\w)/num2en(\w)/g;
But I get following error :
Unquoted string "w" may clash with future reserved word at tocorpus.pl + line 21. syntax error at tocorpus.pl line 22, near ") s/(\w)/num2en(\w)/g" Execution of tocorpus.pl aborted due to compilation errors
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: replace all numerics to words in a txt file
by choroba (Cardinal) on Sep 22, 2017 at 06:33 UTC | |
|
Re: replace all numerics to words in a txt file
by Laurent_R (Canon) on Sep 22, 2017 at 09:26 UTC | |
by anonymized user 468275 (Curate) on Sep 22, 2017 at 09:41 UTC | |
|
Re: replace all numerics to words in a txt file -- oneliner
by Discipulus (Canon) on Sep 22, 2017 at 08:21 UTC | |
by AnomalousMonk (Archbishop) on Sep 22, 2017 at 11:09 UTC |