如何仅使用 grep、awk 和/或 sed,使用 bash 过滤文本文件中的多行模式?

问题描述 投票:0回答:1

我有一个大文件集合(大约 500 万字),每个文件都是通过从 PubMed 的一些 XML 文件中提取一些模式而制成的。我使用了

xgrep -tx "//PMID|//ArticleTitle|//Abstract|//MeshHeadingList"
,所以我拥有包含这些特定 XML 标签的所有行。

但是有些文章没有

<Abstract></Abstract>
标签,我需要将它们过滤掉以进行大学作业。

我有一个使用 pcregrep 的解决方案:

pcregrep -M '<PMID.*</PMID>\n<ArticleTitle>.*</ArticleTitle>\n<Abstract>.*</Abstract>\n<MeshHeadingList>.*</MeshHeadingList>\n' xgrep.txt
瞬间给我正确的输出。问题是 pcregrep 没有安装在我的 Uni 电脑上,所以当他们检查我的脚本时,它不会工作。

仅使用 grep (

grep -Pazo '<PMID.*</PMID>\n<ArticleTitle>.*</ArticleTitle>\n<Abstract>.*</Abstract>\n<MeshHeadingList>.*</MeshHeadingList>\n' xgrep.txt
) 我确实获得了相同的结果,但它花费了荒谬的时间——大约 14-15 分钟。如何仅使用默认的 bash 命令在合理的时间内完成这项工作? -- 更新: 根据评论中的要求,操作系统是 Linux Mint LMDE 5 (Elsie)。 Bash 版本是 5.1.4.

简单地使用 awk 的

/start-pattern/,/end-pattern/
是行不通的,因为文件的所有文章都以相同的模式开始和结束(分别为
<PMID>
</MeshHeadingList>
)。也许我可以使用我不知道的 awk 更高级选项。

更新:

xgrep.txt 文件中的示例:

<PMID Version="1">19</PMID>
<ArticleTitle>Antidepressant drugs affect dopamine uptake.</ArticleTitle>
<MeshHeadingList>         <MeshHeading>           <DescriptorName UI="D000818" MajorTopicYN="N">Animals</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D000928" MajorTopicYN="N">Antidepressive Agents</DescriptorName>           <QualifierName UI="Q000494" MajorTopicYN="Y">pharmacology</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D001921" MajorTopicYN="N">Brain</DescriptorName>           <QualifierName UI="Q000187" MajorTopicYN="N">drug effects</QualifierName>           <QualifierName UI="Q000378" MajorTopicYN="N">metabolism</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D000697" MajorTopicYN="N">Central Nervous System Stimulants</DescriptorName>           <QualifierName UI="Q000494" MajorTopicYN="N">pharmacology</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D003864" MajorTopicYN="N">Depression, Chemical</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D004298" MajorTopicYN="N">Dopamine</DescriptorName>           <QualifierName UI="Q000378" MajorTopicYN="Y">metabolism</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D066298" MajorTopicYN="N">In Vitro Techniques</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D008297" MajorTopicYN="N">Male</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D051381" MajorTopicYN="N">Rats</DescriptorName>         </MeshHeading>       </MeshHeadingList>
<PMID Version="1">20</PMID>
<ArticleTitle>Aggregation of blood platelets by adrenaline and its uptake.</ArticleTitle>
<MeshHeadingList>         <MeshHeading>           <DescriptorName UI="D000818" MajorTopicYN="N">Animals</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D001792" MajorTopicYN="N">Blood Platelets</DescriptorName>           <QualifierName UI="Q000378" MajorTopicYN="Y">metabolism</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D004087" MajorTopicYN="N">Dihydroergotamine</DescriptorName>           <QualifierName UI="Q000494" MajorTopicYN="N">pharmacology</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D004347" MajorTopicYN="N">Drug Interactions</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D004837" MajorTopicYN="N">Epinephrine</DescriptorName>           <QualifierName UI="Q000097" MajorTopicYN="N">blood</QualifierName>           <QualifierName UI="Q000494" MajorTopicYN="Y">pharmacology</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D066298" MajorTopicYN="N">In Vitro Techniques</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D008238" MajorTopicYN="N">Lysergic Acid Diethylamide</DescriptorName>           <QualifierName UI="Q000494" MajorTopicYN="N">pharmacology</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D010974" MajorTopicYN="N">Platelet Aggregation</DescriptorName>           <QualifierName UI="Q000187" MajorTopicYN="Y">drug effects</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D011817" MajorTopicYN="N">Rabbits</DescriptorName>         </MeshHeading>       </MeshHeadingList>
<PMID Version="1">22</PMID>
<ArticleTitle>[Demonstration of tumor inhibiting properties of a strongly immunostimulating low-molecular weight substance. Comparative studies with ifosfamide on the immuno-labile DS carcinosarcoma. Stimulation of the autoimmune activity for approx. 20 days by BA 1, a N-(2-cyanoethylene)-urea. Novel prophylactic possibilities].</ArticleTitle>
<Abstract>           <AbstractText>A report is given on the recent discovery of outstanding immunological properties in BA 1 [N-(2-cyanoethylene)-urea] having a (low) molecular mass M = 111.104. Experiments in 214 DS carcinosarcoma bearing Wistar rats have shown that BA 1, at a dosage of only about 12 percent LD50 (150 mg kg) and negligible lethality (1.7 percent), results in a recovery rate of 40 percent without hyperglycemia and, in one test, of 80 percent with hyperglycemia. Under otherwise unchanged conditions the reference substance ifosfamide (IF) -- a further development of cyclophosphamide -- applied without hyperglycemia in its most efficient dosage of 47 percent LD50 (150 mg kg) brought about a recovery rate of 25 percent at a lethality of 18 percent. (Contrary to BA 1, 250-min hyperglycemia caused no further improvement of the recovery rate.) However this comparison is characterized by the fact that both substances exhibit two quite different (complementary) mechanisms of action. Leucocyte counts made after application of the said cancerostatics and dosages have shown a pronounced stimulation with BA 1 and with ifosfamide, the known suppression in the post-therapeutic interval usually found with standard cancerostatics. In combination with the cited plaque test for BA 1, blood pictures then allow conclusions on the immunity status. Since IF can be taken as one of the most efficient cancerostatics--there is no other chemotherapeutic known up to now that has a more significant effect on the DS carcinosarcoma in rats -- these findings are of special importance. Finally, the total amount of leucocytes and lymphocytes as well as their time behaviour was determined from the blood picture of tumour-free rats after i.v. application of BA 1. The thus obtained numerical values clearly show that further research work on the prophylactic use of this substance seems to be necessary and very promising.</AbstractText>         </Abstract>
<MeshHeadingList>         <MeshHeading>           <DescriptorName UI="D000818" MajorTopicYN="N">Animals</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D000970" MajorTopicYN="N">Antineoplastic Agents</DescriptorName>           <QualifierName UI="Q000494" MajorTopicYN="N">pharmacology</QualifierName>           <QualifierName UI="Q000627" MajorTopicYN="Y">therapeutic use</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D002296" MajorTopicYN="N">Carcinosarcoma</DescriptorName>           <QualifierName UI="Q000188" MajorTopicYN="Y">drug therapy</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D003520" MajorTopicYN="N">Cyclophosphamide</DescriptorName>           <QualifierName UI="Q000031" MajorTopicYN="Y">analogs &amp; derivatives</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D004353" MajorTopicYN="N">Drug Evaluation, Preclinical</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D004361" MajorTopicYN="N">Drug Tolerance</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D004906" MajorTopicYN="N">Erythrocyte Count</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D006863" MajorTopicYN="N">Hydrogen-Ion Concentration</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D006943" MajorTopicYN="N">Hyperglycemia</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D007069" MajorTopicYN="Y">Ifosfamide</DescriptorName>           <QualifierName UI="Q000494" MajorTopicYN="N">pharmacology</QualifierName>           <QualifierName UI="Q000627" MajorTopicYN="N">therapeutic use</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D007109" MajorTopicYN="N">Immunity</DescriptorName>           <QualifierName UI="Q000187" MajorTopicYN="Y">drug effects</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D007165" MajorTopicYN="N">Immunosuppression Therapy</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D007928" MajorTopicYN="N">Lethal Dose 50</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D007958" MajorTopicYN="N">Leukocyte Count</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D008297" MajorTopicYN="N">Male</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D051379" MajorTopicYN="N">Mice</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D009374" MajorTopicYN="N">Neoplasms, Experimental</DescriptorName>           <QualifierName UI="Q000188" MajorTopicYN="N">drug therapy</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D051381" MajorTopicYN="N">Rats</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D013268" MajorTopicYN="N">Stimulation, Chemical</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D013997" MajorTopicYN="N">Time Factors</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D014508" MajorTopicYN="N">Urea</DescriptorName>           <QualifierName UI="Q000031" MajorTopicYN="Y">analogs &amp; derivatives</QualifierName>           <QualifierName UI="Q000494" MajorTopicYN="N">pharmacology</QualifierName>           <QualifierName UI="Q000627" MajorTopicYN="N">therapeutic use</QualifierName>         </MeshHeading>       </MeshHeadingList>
<PMID Version="1">23</PMID>
<ArticleTitle>Effect of etafenone on total and regional myocardial blood flow.</ArticleTitle>
<Abstract>           <AbstractText>The distribution of blood flow to the subendocardial, medium and subepicardial layers of the left ventricular free wall was studied in anaesthetized dogs under normoxic (A), hypoxic (B) conditions and under pharmacologically induced (etafenone) coronary vasodilation (C). Regional myocardial blood flow was determined by means of the particle distribution method. In normoxia a transmural gradient of flow was observed, with the subendocardial layers receiving a significantly higher flow rate compared with the subepicardial layers. In hypoxia induced vasodilation this transmural gradient of flow was persistent. In contrast a marked redistribution of regional flow was observed under pharmacologically induced vasodilation. The transmural gradient decreased. In contrast to some findings these experiments demonstrate that a considerable vasodilatory capacity exists in all layers of the myocardium and can be utilized by drugs. The differences observed for the intramural distribution pattern of flow under hypoxia and drug induced vasodilation support the hypothesis that this pattern reflects corresponding gradients of regional myocardial metabolism.</AbstractText>         </Abstract>
<MeshHeadingList>         <MeshHeading>           <DescriptorName UI="D000818" MajorTopicYN="N">Animals</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D001794" MajorTopicYN="N">Blood Pressure</DescriptorName>           <QualifierName UI="Q000187" MajorTopicYN="N">drug effects</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D002245" MajorTopicYN="N">Carbon Dioxide</DescriptorName>           <QualifierName UI="Q000097" MajorTopicYN="N">blood</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D002302" MajorTopicYN="N">Cardiac Output</DescriptorName>           <QualifierName UI="Q000187" MajorTopicYN="N">drug effects</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D003326" MajorTopicYN="N">Coronary Circulation</DescriptorName>           <QualifierName UI="Q000187" MajorTopicYN="Y">drug effects</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D003331" MajorTopicYN="N">Coronary Vessels</DescriptorName>           <QualifierName UI="Q000187" MajorTopicYN="N">drug effects</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D004285" MajorTopicYN="N">Dogs</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D006339" MajorTopicYN="N">Heart Rate</DescriptorName>           <QualifierName UI="Q000187" MajorTopicYN="N">drug effects</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D006346" MajorTopicYN="N">Heart Septum</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D006352" MajorTopicYN="N">Heart Ventricles</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D006863" MajorTopicYN="N">Hydrogen-Ion Concentration</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D000860" MajorTopicYN="N">Hypoxia</DescriptorName>           <QualifierName UI="Q000503" MajorTopicYN="N">physiopathology</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D010100" MajorTopicYN="N">Oxygen</DescriptorName>           <QualifierName UI="Q000097" MajorTopicYN="N">blood</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D011427" MajorTopicYN="N">Propiophenones</DescriptorName>           <QualifierName UI="Q000494" MajorTopicYN="Y">pharmacology</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D014665" MajorTopicYN="N">Vasodilator Agents</DescriptorName>           <QualifierName UI="Q000494" MajorTopicYN="Y">pharmacology</QualifierName>         </MeshHeading>       </MeshHeadingList>

期望的输出:

<PMID Version="1">22</PMID>
<ArticleTitle>[Demonstration of tumor inhibiting properties of a strongly immunostimulating low-molecular weight substance. Comparative studies with ifosfamide on the immuno-labile DS carcinosarcoma. Stimulation of the autoimmune activity for approx. 20 days by BA 1, a N-(2-cyanoethylene)-urea. Novel prophylactic possibilities].</ArticleTitle>
<Abstract>           <AbstractText>A report is given on the recent discovery of outstanding immunological properties in BA 1 [N-(2-cyanoethylene)-urea] having a (low) molecular mass M = 111.104. Experiments in 214 DS carcinosarcoma bearing Wistar rats have shown that BA 1, at a dosage of only about 12 percent LD50 (150 mg kg) and negligible lethality (1.7 percent), results in a recovery rate of 40 percent without hyperglycemia and, in one test, of 80 percent with hyperglycemia. Under otherwise unchanged conditions the reference substance ifosfamide (IF) -- a further development of cyclophosphamide -- applied without hyperglycemia in its most efficient dosage of 47 percent LD50 (150 mg kg) brought about a recovery rate of 25 percent at a lethality of 18 percent. (Contrary to BA 1, 250-min hyperglycemia caused no further improvement of the recovery rate.) However this comparison is characterized by the fact that both substances exhibit two quite different (complementary) mechanisms of action. Leucocyte counts made after application of the said cancerostatics and dosages have shown a pronounced stimulation with BA 1 and with ifosfamide, the known suppression in the post-therapeutic interval usually found with standard cancerostatics. In combination with the cited plaque test for BA 1, blood pictures then allow conclusions on the immunity status. Since IF can be taken as one of the most efficient cancerostatics--there is no other chemotherapeutic known up to now that has a more significant effect on the DS carcinosarcoma in rats -- these findings are of special importance. Finally, the total amount of leucocytes and lymphocytes as well as their time behaviour was determined from the blood picture of tumour-free rats after i.v. application of BA 1. The thus obtained numerical values clearly show that further research work on the prophylactic use of this substance seems to be necessary and very promising.</AbstractText>         </Abstract>
<MeshHeadingList>         <MeshHeading>           <DescriptorName UI="D000818" MajorTopicYN="N">Animals</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D000970" MajorTopicYN="N">Antineoplastic Agents</DescriptorName>           <QualifierName UI="Q000494" MajorTopicYN="N">pharmacology</QualifierName>           <QualifierName UI="Q000627" MajorTopicYN="Y">therapeutic use</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D002296" MajorTopicYN="N">Carcinosarcoma</DescriptorName>           <QualifierName UI="Q000188" MajorTopicYN="Y">drug therapy</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D003520" MajorTopicYN="N">Cyclophosphamide</DescriptorName>           <QualifierName UI="Q000031" MajorTopicYN="Y">analogs &amp; derivatives</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D004353" MajorTopicYN="N">Drug Evaluation, Preclinical</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D004361" MajorTopicYN="N">Drug Tolerance</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D004906" MajorTopicYN="N">Erythrocyte Count</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D006863" MajorTopicYN="N">Hydrogen-Ion Concentration</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D006943" MajorTopicYN="N">Hyperglycemia</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D007069" MajorTopicYN="Y">Ifosfamide</DescriptorName>           <QualifierName UI="Q000494" MajorTopicYN="N">pharmacology</QualifierName>           <QualifierName UI="Q000627" MajorTopicYN="N">therapeutic use</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D007109" MajorTopicYN="N">Immunity</DescriptorName>           <QualifierName UI="Q000187" MajorTopicYN="Y">drug effects</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D007165" MajorTopicYN="N">Immunosuppression Therapy</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D007928" MajorTopicYN="N">Lethal Dose 50</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D007958" MajorTopicYN="N">Leukocyte Count</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D008297" MajorTopicYN="N">Male</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D051379" MajorTopicYN="N">Mice</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D009374" MajorTopicYN="N">Neoplasms, Experimental</DescriptorName>           <QualifierName UI="Q000188" MajorTopicYN="N">drug therapy</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D051381" MajorTopicYN="N">Rats</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D013268" MajorTopicYN="N">Stimulation, Chemical</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D013997" MajorTopicYN="N">Time Factors</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D014508" MajorTopicYN="N">Urea</DescriptorName>           <QualifierName UI="Q000031" MajorTopicYN="Y">analogs &amp; derivatives</QualifierName>           <QualifierName UI="Q000494" MajorTopicYN="N">pharmacology</QualifierName>           <QualifierName UI="Q000627" MajorTopicYN="N">therapeutic use</QualifierName>         </MeshHeading>       </MeshHeadingList>
<PMID Version="1">23</PMID>
<ArticleTitle>Effect of etafenone on total and regional myocardial blood flow.</ArticleTitle>
<Abstract>           <AbstractText>The distribution of blood flow to the subendocardial, medium and subepicardial layers of the left ventricular free wall was studied in anaesthetized dogs under normoxic (A), hypoxic (B) conditions and under pharmacologically induced (etafenone) coronary vasodilation (C). Regional myocardial blood flow was determined by means of the particle distribution method. In normoxia a transmural gradient of flow was observed, with the subendocardial layers receiving a significantly higher flow rate compared with the subepicardial layers. In hypoxia induced vasodilation this transmural gradient of flow was persistent. In contrast a marked redistribution of regional flow was observed under pharmacologically induced vasodilation. The transmural gradient decreased. In contrast to some findings these experiments demonstrate that a considerable vasodilatory capacity exists in all layers of the myocardium and can be utilized by drugs. The differences observed for the intramural distribution pattern of flow under hypoxia and drug induced vasodilation support the hypothesis that this pattern reflects corresponding gradients of regional myocardial metabolism.</AbstractText>         </Abstract>
<MeshHeadingList>         <MeshHeading>           <DescriptorName UI="D000818" MajorTopicYN="N">Animals</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D001794" MajorTopicYN="N">Blood Pressure</DescriptorName>           <QualifierName UI="Q000187" MajorTopicYN="N">drug effects</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D002245" MajorTopicYN="N">Carbon Dioxide</DescriptorName>           <QualifierName UI="Q000097" MajorTopicYN="N">blood</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D002302" MajorTopicYN="N">Cardiac Output</DescriptorName>           <QualifierName UI="Q000187" MajorTopicYN="N">drug effects</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D003326" MajorTopicYN="N">Coronary Circulation</DescriptorName>           <QualifierName UI="Q000187" MajorTopicYN="Y">drug effects</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D003331" MajorTopicYN="N">Coronary Vessels</DescriptorName>           <QualifierName UI="Q000187" MajorTopicYN="N">drug effects</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D004285" MajorTopicYN="N">Dogs</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D006339" MajorTopicYN="N">Heart Rate</DescriptorName>           <QualifierName UI="Q000187" MajorTopicYN="N">drug effects</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D006346" MajorTopicYN="N">Heart Septum</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D006352" MajorTopicYN="N">Heart Ventricles</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D006863" MajorTopicYN="N">Hydrogen-Ion Concentration</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D000860" MajorTopicYN="N">Hypoxia</DescriptorName>           <QualifierName UI="Q000503" MajorTopicYN="N">physiopathology</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D010100" MajorTopicYN="N">Oxygen</DescriptorName>           <QualifierName UI="Q000097" MajorTopicYN="N">blood</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D011427" MajorTopicYN="N">Propiophenones</DescriptorName>           <QualifierName UI="Q000494" MajorTopicYN="Y">pharmacology</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D014665" MajorTopicYN="N">Vasodilator Agents</DescriptorName>           <QualifierName UI="Q000494" MajorTopicYN="Y">pharmacology</QualifierName>         </MeshHeading>       </MeshHeadingList>
bash awk sed grep text-processing
1个回答
0
投票

使用

sed

$ sed -En '/<PMID|>\[|<Abstract/{N;/>\[|<Abstract|<MeshHeadingList/p;}' input_file
<PMID Version="1">21</PMID>
<ArticleTitle>[Biochemical studies on camomile components/III. In vitro studies about the antipeptic activity of (--)-alpha-bisabolol (author's transl)].</ArticleTitle>
<Abstract>           <AbstractText>(--)-alpha-Bisabolol has a primary antipeptic action depending on dosage, which is not caused by an alteration of the pH-value. The proteolytic activity of pepsin is reduced by 50 percent through addition of bisabolol in the ratio of 1/0.5. The antipeptic action of bisabolol only occurs in case of direct contact. In case of a previous contact with the substrate, the inhibiting effect is lost.</AbstractText>         </Abstract>
<MeshHeadingList>         <MeshHeading>           <DescriptorName UI="D004305" MajorTopicYN="N">Dose-Response Relationship, Drug</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D006454" MajorTopicYN="N">Hemoglobins</DescriptorName>           <QualifierName UI="Q000378" MajorTopicYN="N">metabolism</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D006863" MajorTopicYN="N">Hydrogen-Ion Concentration</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D066298" MajorTopicYN="N">In Vitro Techniques</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D008722" MajorTopicYN="N">Methods</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D010434" MajorTopicYN="N">Pepsin A</DescriptorName>           <QualifierName UI="Q000037" MajorTopicYN="Y">antagonists &amp; inhibitors</QualifierName>           <QualifierName UI="Q000378" MajorTopicYN="N">metabolism</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D010946" MajorTopicYN="N">Plants, Medicinal</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D012717" MajorTopicYN="N">Sesquiterpenes</DescriptorName>           <QualifierName UI="Q000494" MajorTopicYN="Y">pharmacology</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D013056" MajorTopicYN="N">Spectrophotometry, Ultraviolet</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D014238" MajorTopicYN="N">Trichloroacetic Acid</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D014443" MajorTopicYN="N">Tyrosine</DescriptorName>           <QualifierName UI="Q000378" MajorTopicYN="N">metabolism</QualifierName>         </MeshHeading>       </MeshHeadingList>
<PMID Version="1">22</PMID>
<ArticleTitle>[Demonstration of tumor inhibiting properties of a strongly immunostimulating low-molecular weight substance. Comparative studies with ifosfamide on the immuno-labile DS carcinosarcoma. Stimulation of the autoimmune activity for approx. 20 days by BA 1, a N-(2-cyanoethylene)-urea. Novel prophylactic possibilities].</ArticleTitle>
<Abstract>           <AbstractText>A report is given on the recent discovery of outstanding immunological properties in BA 1 [N-(2-cyanoethylene)-urea] having a (low) molecular mass M = 111.104. Experiments in 214 DS carcinosarcoma bearing Wistar rats have shown that BA 1, at a dosage of only about 12 percent LD50 (150 mg kg) and negligible lethality (1.7 percent), results in a recovery rate of 40 percent without hyperglycemia and, in one test, of 80 percent with hyperglycemia. Under otherwise unchanged conditions the reference substance ifosfamide (IF) -- a further development of cyclophosphamide -- applied without hyperglycemia in its most efficient dosage of 47 percent LD50 (150 mg kg) brought about a recovery rate of 25 percent at a lethality of 18 percent. (Contrary to BA 1, 250-min hyperglycemia caused no further improvement of the recovery rate.) However this comparison is characterized by the fact that both substances exhibit two quite different (complementary) mechanisms of action. Leucocyte counts made after application of the said cancerostatics and dosages have shown a pronounced stimulation with BA 1 and with ifosfamide, the known suppression in the post-therapeutic interval usually found with standard cancerostatics. In combination with the cited plaque test for BA 1, blood pictures then allow conclusions on the immunity status. Since IF can be taken as one of the most efficient cancerostatics--there is no other chemotherapeutic known up to now that has a more significant effect on the DS carcinosarcoma in rats -- these findings are of special importance. Finally, the total amount of leucocytes and lymphocytes as well as their time behaviour was determined from the blood picture of tumour-free rats after i.v. application of BA 1. The thus obtained numerical values clearly show that further research work on the prophylactic use of this substance seems to be necessary and very promising.</AbstractText>         </Abstract>
<MeshHeadingList>         <MeshHeading>           <DescriptorName UI="D000818" MajorTopicYN="N">Animals</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D000970" MajorTopicYN="N">Antineoplastic Agents</DescriptorName>           <QualifierName UI="Q000494" MajorTopicYN="N">pharmacology</QualifierName>           <QualifierName UI="Q000627" MajorTopicYN="Y">therapeutic use</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D002296" MajorTopicYN="N">Carcinosarcoma</DescriptorName>           <QualifierName UI="Q000188" MajorTopicYN="Y">drug therapy</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D003520" MajorTopicYN="N">Cyclophosphamide</DescriptorName>           <QualifierName UI="Q000031" MajorTopicYN="Y">analogs &amp; derivatives</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D004353" MajorTopicYN="N">Drug Evaluation, Preclinical</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D004361" MajorTopicYN="N">Drug Tolerance</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D004906" MajorTopicYN="N">Erythrocyte Count</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D006863" MajorTopicYN="N">Hydrogen-Ion Concentration</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D006943" MajorTopicYN="N">Hyperglycemia</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D007069" MajorTopicYN="Y">Ifosfamide</DescriptorName>           <QualifierName UI="Q000494" MajorTopicYN="N">pharmacology</QualifierName>           <QualifierName UI="Q000627" MajorTopicYN="N">therapeutic use</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D007109" MajorTopicYN="N">Immunity</DescriptorName>           <QualifierName UI="Q000187" MajorTopicYN="Y">drug effects</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D007165" MajorTopicYN="N">Immunosuppression Therapy</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D007928" MajorTopicYN="N">Lethal Dose 50</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D007958" MajorTopicYN="N">Leukocyte Count</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D008297" MajorTopicYN="N">Male</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D051379" MajorTopicYN="N">Mice</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D009374" MajorTopicYN="N">Neoplasms, Experimental</DescriptorName>           <QualifierName UI="Q000188" MajorTopicYN="N">drug therapy</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D051381" MajorTopicYN="N">Rats</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D013268" MajorTopicYN="N">Stimulation, Chemical</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D013997" MajorTopicYN="N">Time Factors</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D014508" MajorTopicYN="N">Urea</DescriptorName>           <QualifierName UI="Q000031" MajorTopicYN="Y">analogs &amp; derivatives</QualifierName>           <QualifierName UI="Q000494" MajorTopicYN="N">pharmacology</QualifierName>           <QualifierName UI="Q000627" MajorTopicYN="N">therapeutic use</QualifierName>         </MeshHeading>       </MeshHeadingList>
© www.soinside.com 2019 - 2024. All rights reserved.