mercredi 30 novembre 2016

Extracting line between two pattern using Sed and the next pattern should come in new paragraph in mac

I want to extract all lines that comes between two citation. I want to include first sentence containing citation and should stop extraction when new citation comes. This process should continue till end of file. I am using Mac. The two pattens must be separated by blank lines or some dashed lines. This is my input data which i extracted using command

sed -n '/([1-2][0-9]{3})/,/^([1-2][0-9]{3})/p;/^(*[1-2][0-9]{3})/q'

But i want the output should come like this


Any personal bias by authors has to be hedged (Hyland, 1995).

Negative sentiment is politically particularly dangerous (Ziman, 1968), and some authors have documented the strategy of prefacing the intended criticism by slightly disingenuous praise (MacRoberts and MacRoberts, 1984). This makes the problem of identifying such opinions particularly challenging.

This nonlocal expression of sentiment has been observed in other genres as well (Wilson et al., 2009; Polanyi and Zaenen, 2006).

Aucun commentaire:

Enregistrer un commentaire