question on sed
I have a file (file01) with several words that I need to output to another file (file02). I need file02 to be formated to a single column, will all non-alphabet characters removed, except for dash (-) and appostrophe (') characters.
When I use the following, it formats correcly and removes all non-alphabet characters (including ' and -)
tr ' ' '\n' <$FILEDIR/file01 | sed -e 's/[^a-z A-Z]//;/^$/ d' >$FILEDIR/file02
When I try to specify the exclusion of ' and - characters as in below, the command fails. What am I doing wrong?
tr ' ' '\n' <$FILEDIR/file01 | sed -e 's/[^a-z A-Z]//;s/[']//; s/[\-];/^$/ d' >$FILEDIR/file02
Thanks
Omar
|