For example,
if there is:
hello(abcdef) = 3
good(adss) = 5
then I have to replace these into:
hello
good
Thus I need to delete each line from '(' to right '\n' and replate these into '\n'
Is is possible by using sed or awk?
For example,
if there is:
hello(abcdef) = 3
good(adss) = 5
then I have to replace these into:
hello
good
Thus I need to delete each line from '(' to right '\n' and replate these into '\n'
Is is possible by using sed or awk?
Using awk
:
awk -F '(' '{ print $1 }' file
Using cut
:
cut -d '(' -f 1 file
Using sed
:
sed 's/(.*//' file
Following awk
may help you on same.
awk '{sub(/\(.*/,"")} 1' Input_file
With sed
:
sed 's/(.*//' Input_file