Quote:
Originally Posted by grail
No you don't need the bash while loop and so on as it will stand alone.
Easiest way to do what you are asking is:
Code:
awk -F"[ =]" '$8 == "noun"{line=$0;$6=$6"s";$0=line"\n"$0}1' file
|
Hi grail,
its my fault not to see the result carefully. Yes, it add one line with modification as expected !
Thats great job !
Can this command do more than one modification ? For example, not only add "s" after the "noun" but also add "s" after verb, "ed" after verb.
for example if we have this:
type=weaksubj len=1 word1=abandonment pos1=noun stemmed1=n priorpolarity=negative
type=weaksubj len=1 word1=abandoned pos1=adj stemmed1=n priorpolarity=negative
type=weaksubj len=1 word1=abandon pos1=verb stemmed1=y priorpolarity=negative
type=strongsubj len=1 word1=abase pos1=verb stemmed1=y priorpolarity=negative
it will becomes this:
type=weaksubj len=1 word1=abandonment pos1=noun stemmed1=n priorpolarity=negative
type=weaksubj len=1 word1=abandonments pos1=noun stemmed1=n priorpolarity=negative
type=weaksubj len=1 word1=abandoned pos1=adj stemmed1=n priorpolarity=negative
type=weaksubj len=1 word1=abandon pos1=verb stemmed1=y priorpolarity=negative
type=weaksubj len=1 word1=abandons pos1=verb stemmed1=y priorpolarity=negative
type=weaksubj len=1 word1=abandoned pos1=verb stemmed1=y priorpolarity=negative
type=strongsubj len=1 word1=abase pos1=verb stemmed1=y priorpolarity=negative
type=strongsubj len=1 word1=abases pos1=verb stemmed1=y priorpolarity=negative
type=strongsubj len=1 word1=abased pos1=verb stemmed1=y priorpolarity=negative
Which is quite similar job but how to make it do the job one time, not repeat and make redundancy?