help me

I want to know how can I write shell programming which remove all numaric value from one file. But that file contain both numaric and string charecter.
after run that script all string charecters are remain as it is. please help me as soon as possible.

tr command is not working. please tell me how can I write that tr command.

Use tr command to remove numeric value from the file

Any of these will work

cat myfile.txt | tr -d 0-9
sed -e 's/[0-9]//g' file.txt
perl -p -e 's/[0-9]//g' file.txt

UUOC

tr -d 0-9 < file > newfile

Hi, rinku.

What do you consider a "numeric value"? Only characters 0-9? A string like 3.14159? How about -0.707E+1?

The more precise you are, the better the answers. Descriptive titles on your threads will help, too, such as "How to delete numeric values".

Duplicate posts will not endear you to the forum members ... cheers, drl

It is only useless if it has or serves no purpose.

In the past I've found that with new shell users it is easier to explain commands piped together rather than explain redirection. Therefore the purpose is simplicity.

The counter argument is, of course you should give the 'proper' answer the first time. Personal preference I guess.

yup, cat's purpose is to join files, and cat "filename" | <someothercmd> serves no purpose except to waste time "opening" another process

<, >> , > and | are all taught as basic shell operations. we use >, >> often to redirect to files.etc.. same with < for input.

Undeniable though it is that the pipe and redirect operators are taught as shell basics, I feel it is unlikely that someone with understanding of those basics would of asked the question in the first place.

I'm afraid we will have to agree to disagree :frowning: