in reply to Removing white space from the file
So you would need something like this:
However, this being Perl, you have some command line options which will do the boiler plate code (opening and closing the files, reading input line by line, and file renaming) for you behind the scene, so that this one-liner (or the almost identical one proposed by vinoth.ree) will do everything for you:# ... open my $in, "<", "uuu.txt" or die "cannot open the input file$!"; open my $out, ">", "out.txt" or die "cannot open the output file$!"; while (my $line = <$in>) { $line =~s/[\s\d]//g; print $out "$line\n"; } close $_ for ($in, $out); # ... renaming, etc.
perl -i.bak -p -e 's/[0-9\s]//g' uuu.txt
|
|---|