Tuesday, 3 September 2013

Sed to remove everything after "." in file using * command?

Sed to remove everything after "." in file using * command?

I have the following data.txt:
95 flour.
47 water.s
etc..
I need to remove everything after the period . in the file to yield
something like this:
95 flour
47 water
etc..
I have tried the using these sed command without success, which yield a
blank document:
sed "s/'.*//" data.txt > cleaned.txt
sed 's/\.*//' data.txt > cleaned.txt

No comments:

Post a Comment