Search Results

Search: Posts Made By: danbroz
9,597
Posted By Jotne
With awk awk '{gsub(/\. /,".\n");print}'...
With awk
awk '{gsub(/\. /,".\n");print}' infile
9,597
Posted By alister
That will convert every period and space to a...
That will convert every period and space to a newline, not append a newline after the period.




If that doesn't work for the OP, it's probably because \n in the replacement text is a GNU...
2,999
Posted By ripat
This regex seems to also return the required...
This regex seems to also return the required output:

grep -o "([^)]\+ [0-9]\{4\})" file

But it will fail on the citations spread on multiple lines as in:


Suggestion, first get rid of all...
2,999
Posted By RudiC
Yes, instead of the -A5 option you used before...
Yes, instead of the -A5 option you used before try -B5. AND, read the man page.
BTW, this would not yield the sentence but the last 5 lines before. If you go for the sentence, this will become...
2,999
Posted By RudiC
This would yield all lines from your sample above...
This would yield all lines from your sample above but suppress many other text lines. If it's too open, try narrowing it down by becoming more specific, e.g. on the year numbers:$ grep -E...
Showing results 1 to 5 of 5

 
All times are GMT -4. The time now is 11:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy