你可以使用bash中的grep、awk和/或sed来过滤文本文件中的多行模式吗?

huangapple go评论58阅读模式
英文:

How can I filter a multi-line pattern across a text file with bash, only using grep, awk and/or sed?

问题

我有一堆大文件(大约500万字),每个文件都是通过从PubMed的一些XML文件中使用xgrep来提取一些模式创建的。我使用了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,所以当他们审查我的脚本时它不会起作用。

只使用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>抗抑郁药物影响多巴胺摄取。</ArticleTitle>
<MeshHeadingList>         <MeshHeading>           <DescriptorName UI="D000818" MajorTopicYN="N">Animals</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D000928" MajorTopicYN="N">抗抑郁药物</DescriptorName>           <QualifierName UI="Q000494" MajorTopicYN="Y">药理学</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D001921" MajorTopicYN="N">脑</DescriptorName>           <QualifierName UI="Q000187" MajorTopicYN="N">药物作用</QualifierName>           <QualifierName UI="Q000378" MajorTopicYN="N">代谢</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D000697" MajorTopicYN="N">中枢神经系统兴奋剂</DescriptorName>           <QualifierName UI="Q000494" MajorTopicYN="N">药理学</QualifierName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D003864" MajorTopicYN="N">化学性抑郁症</DescriptorName>         </MeshHeading>         <MeshHeading>           <DescriptorName UI="D004298" MajorTopicYN="N">多巴胺</DescriptorName>           <QualifierName UI

<details>
<summary>英文:</summary>

I have a collection of big files (around 5 million words), each made by xgrepping some patterns from a few XML files from PubMed. I used `xgrep -tx &quot;//PMID|//ArticleTitle|//Abstract|//MeshHeadingList&quot;`, so I have all the lines that contain these specific XML tags.

But some of the articles don&#39;t have the `&lt;Abstract&gt;&lt;/Abstract&gt;` tag, and I need to filter those out for a college assignment.

I have a solution using pcregrep: `pcregrep -M &#39;&lt;PMID.*&lt;/PMID&gt;\n&lt;ArticleTitle&gt;.*&lt;/ArticleTitle&gt;\n&lt;Abstract&gt;.*&lt;/Abstract&gt;\n&lt;MeshHeadingList&gt;.*&lt;/MeshHeadingList&gt;\n&#39; xgrep.txt` gives me the correct output in a split-second. The problem is that pcregrep isn&#39;t installed in my Uni&#39;s PCs, so when they review my scripts it&#39;s not gonna work.

Using only grep (`grep -Pazo &#39;&lt;PMID.*&lt;/PMID&gt;\n&lt;ArticleTitle&gt;.*&lt;/ArticleTitle&gt;\n&lt;Abstract&gt;.*&lt;/Abstract&gt;\n&lt;MeshHeadingList&gt;.*&lt;/MeshHeadingList&gt;\n&#39; xgrep.txt`) I do achieve the same result, but it takes an absurd amount of time -- around 14-15 minutes. How can I make this work in a reasonable time with only default bash commands? -- **Update:** as requested in comments, OS is Linux Mint LMDE 5 (Elsie). Bash version is 5.1.4.

Simply using awk&#39;s `/start-pattern/,/end-pattern/` doesn&#39;t work, because all of the file&#39;s articles begin and end with the same pattern (`&lt;PMID&gt;` and `&lt;/MeshHeadingList&gt;`, respectively). Maybe there&#39;s a more advanced option for awk I could use that I don&#39;t know about.

**Update:**

Example from the xgrep.txt file:

```xml
&lt;PMID Version=&quot;1&quot;&gt;19&lt;/PMID&gt;
&lt;ArticleTitle&gt;Antidepressant drugs affect dopamine uptake.&lt;/ArticleTitle&gt;
&lt;MeshHeadingList&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D000818&quot; MajorTopicYN=&quot;N&quot;&gt;Animals&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D000928&quot; MajorTopicYN=&quot;N&quot;&gt;Antidepressive Agents&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000494&quot; MajorTopicYN=&quot;Y&quot;&gt;pharmacology&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D001921&quot; MajorTopicYN=&quot;N&quot;&gt;Brain&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000187&quot; MajorTopicYN=&quot;N&quot;&gt;drug effects&lt;/QualifierName&gt;           &lt;QualifierName UI=&quot;Q000378&quot; MajorTopicYN=&quot;N&quot;&gt;metabolism&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D000697&quot; MajorTopicYN=&quot;N&quot;&gt;Central Nervous System Stimulants&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000494&quot; MajorTopicYN=&quot;N&quot;&gt;pharmacology&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D003864&quot; MajorTopicYN=&quot;N&quot;&gt;Depression, Chemical&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D004298&quot; MajorTopicYN=&quot;N&quot;&gt;Dopamine&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000378&quot; MajorTopicYN=&quot;Y&quot;&gt;metabolism&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D066298&quot; MajorTopicYN=&quot;N&quot;&gt;In Vitro Techniques&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D008297&quot; MajorTopicYN=&quot;N&quot;&gt;Male&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D051381&quot; MajorTopicYN=&quot;N&quot;&gt;Rats&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;       &lt;/MeshHeadingList&gt;
&lt;PMID Version=&quot;1&quot;&gt;20&lt;/PMID&gt;
&lt;ArticleTitle&gt;Aggregation of blood platelets by adrenaline and its uptake.&lt;/ArticleTitle&gt;
&lt;MeshHeadingList&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D000818&quot; MajorTopicYN=&quot;N&quot;&gt;Animals&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D001792&quot; MajorTopicYN=&quot;N&quot;&gt;Blood Platelets&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000378&quot; MajorTopicYN=&quot;Y&quot;&gt;metabolism&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D004087&quot; MajorTopicYN=&quot;N&quot;&gt;Dihydroergotamine&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000494&quot; MajorTopicYN=&quot;N&quot;&gt;pharmacology&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D004347&quot; MajorTopicYN=&quot;N&quot;&gt;Drug Interactions&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D004837&quot; MajorTopicYN=&quot;N&quot;&gt;Epinephrine&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000097&quot; MajorTopicYN=&quot;N&quot;&gt;blood&lt;/QualifierName&gt;           &lt;QualifierName UI=&quot;Q000494&quot; MajorTopicYN=&quot;Y&quot;&gt;pharmacology&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D066298&quot; MajorTopicYN=&quot;N&quot;&gt;In Vitro Techniques&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D008238&quot; MajorTopicYN=&quot;N&quot;&gt;Lysergic Acid Diethylamide&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000494&quot; MajorTopicYN=&quot;N&quot;&gt;pharmacology&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D010974&quot; MajorTopicYN=&quot;N&quot;&gt;Platelet Aggregation&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000187&quot; MajorTopicYN=&quot;Y&quot;&gt;drug effects&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D011817&quot; MajorTopicYN=&quot;N&quot;&gt;Rabbits&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;       &lt;/MeshHeadingList&gt;
&lt;PMID Version=&quot;1&quot;&gt;22&lt;/PMID&gt;
&lt;ArticleTitle&gt;[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].&lt;/ArticleTitle&gt;
&lt;Abstract&gt;           &lt;AbstractText&gt;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.&lt;/AbstractText&gt;         &lt;/Abstract&gt;
&lt;MeshHeadingList&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D000818&quot; MajorTopicYN=&quot;N&quot;&gt;Animals&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D000970&quot; MajorTopicYN=&quot;N&quot;&gt;Antineoplastic Agents&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000494&quot; MajorTopicYN=&quot;N&quot;&gt;pharmacology&lt;/QualifierName&gt;           &lt;QualifierName UI=&quot;Q000627&quot; MajorTopicYN=&quot;Y&quot;&gt;therapeutic use&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D002296&quot; MajorTopicYN=&quot;N&quot;&gt;Carcinosarcoma&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000188&quot; MajorTopicYN=&quot;Y&quot;&gt;drug therapy&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D003520&quot; MajorTopicYN=&quot;N&quot;&gt;Cyclophosphamide&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000031&quot; MajorTopicYN=&quot;Y&quot;&gt;analogs &amp;amp; derivatives&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D004353&quot; MajorTopicYN=&quot;N&quot;&gt;Drug Evaluation, Preclinical&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D004361&quot; MajorTopicYN=&quot;N&quot;&gt;Drug Tolerance&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D004906&quot; MajorTopicYN=&quot;N&quot;&gt;Erythrocyte Count&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D006863&quot; MajorTopicYN=&quot;N&quot;&gt;Hydrogen-Ion Concentration&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D006943&quot; MajorTopicYN=&quot;N&quot;&gt;Hyperglycemia&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D007069&quot; MajorTopicYN=&quot;Y&quot;&gt;Ifosfamide&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000494&quot; MajorTopicYN=&quot;N&quot;&gt;pharmacology&lt;/QualifierName&gt;           &lt;QualifierName UI=&quot;Q000627&quot; MajorTopicYN=&quot;N&quot;&gt;therapeutic use&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D007109&quot; MajorTopicYN=&quot;N&quot;&gt;Immunity&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000187&quot; MajorTopicYN=&quot;Y&quot;&gt;drug effects&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D007165&quot; MajorTopicYN=&quot;N&quot;&gt;Immunosuppression Therapy&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D007928&quot; MajorTopicYN=&quot;N&quot;&gt;Lethal Dose 50&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D007958&quot; MajorTopicYN=&quot;N&quot;&gt;Leukocyte Count&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D008297&quot; MajorTopicYN=&quot;N&quot;&gt;Male&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D051379&quot; MajorTopicYN=&quot;N&quot;&gt;Mice&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D009374&quot; MajorTopicYN=&quot;N&quot;&gt;Neoplasms, Experimental&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000188&quot; MajorTopicYN=&quot;N&quot;&gt;drug therapy&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D051381&quot; MajorTopicYN=&quot;N&quot;&gt;Rats&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D013268&quot; MajorTopicYN=&quot;N&quot;&gt;Stimulation, Chemical&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D013997&quot; MajorTopicYN=&quot;N&quot;&gt;Time Factors&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D014508&quot; MajorTopicYN=&quot;N&quot;&gt;Urea&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000031&quot; MajorTopicYN=&quot;Y&quot;&gt;analogs &amp;amp; derivatives&lt;/QualifierName&gt;           &lt;QualifierName UI=&quot;Q000494&quot; MajorTopicYN=&quot;N&quot;&gt;pharmacology&lt;/QualifierName&gt;           &lt;QualifierName UI=&quot;Q000627&quot; MajorTopicYN=&quot;N&quot;&gt;therapeutic use&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;       &lt;/MeshHeadingList&gt;
&lt;PMID Version=&quot;1&quot;&gt;23&lt;/PMID&gt;
&lt;ArticleTitle&gt;Effect of etafenone on total and regional myocardial blood flow.&lt;/ArticleTitle&gt;
&lt;Abstract&gt;           &lt;AbstractText&gt;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.&lt;/AbstractText&gt;         &lt;/Abstract&gt;
&lt;MeshHeadingList&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D000818&quot; MajorTopicYN=&quot;N&quot;&gt;Animals&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D001794&quot; MajorTopicYN=&quot;N&quot;&gt;Blood Pressure&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000187&quot; MajorTopicYN=&quot;N&quot;&gt;drug effects&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D002245&quot; MajorTopicYN=&quot;N&quot;&gt;Carbon Dioxide&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000097&quot; MajorTopicYN=&quot;N&quot;&gt;blood&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D002302&quot; MajorTopicYN=&quot;N&quot;&gt;Cardiac Output&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000187&quot; MajorTopicYN=&quot;N&quot;&gt;drug effects&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D003326&quot; MajorTopicYN=&quot;N&quot;&gt;Coronary Circulation&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000187&quot; MajorTopicYN=&quot;Y&quot;&gt;drug effects&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D003331&quot; MajorTopicYN=&quot;N&quot;&gt;Coronary Vessels&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000187&quot; MajorTopicYN=&quot;N&quot;&gt;drug effects&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D004285&quot; MajorTopicYN=&quot;N&quot;&gt;Dogs&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D006339&quot; MajorTopicYN=&quot;N&quot;&gt;Heart Rate&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000187&quot; MajorTopicYN=&quot;N&quot;&gt;drug effects&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D006346&quot; MajorTopicYN=&quot;N&quot;&gt;Heart Septum&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D006352&quot; MajorTopicYN=&quot;N&quot;&gt;Heart Ventricles&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D006863&quot; MajorTopicYN=&quot;N&quot;&gt;Hydrogen-Ion Concentration&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D000860&quot; MajorTopicYN=&quot;N&quot;&gt;Hypoxia&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000503&quot; MajorTopicYN=&quot;N&quot;&gt;physiopathology&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D010100&quot; MajorTopicYN=&quot;N&quot;&gt;Oxygen&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000097&quot; MajorTopicYN=&quot;N&quot;&gt;blood&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D011427&quot; MajorTopicYN=&quot;N&quot;&gt;Propiophenones&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000494&quot; MajorTopicYN=&quot;Y&quot;&gt;pharmacology&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D014665&quot; MajorTopicYN=&quot;N&quot;&gt;Vasodilator Agents&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000494&quot; MajorTopicYN=&quot;Y&quot;&gt;pharmacology&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;       &lt;/MeshHeadingList&gt;

Desired output:

&lt;PMID Version=&quot;1&quot;&gt;22&lt;/PMID&gt;
&lt;ArticleTitle&gt;[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].&lt;/ArticleTitle&gt;
&lt;Abstract&gt;           &lt;AbstractText&gt;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.&lt;/AbstractText&gt;         &lt;/Abstract&gt;
&lt;MeshHeadingList&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D000818&quot; MajorTopicYN=&quot;N&quot;&gt;Animals&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D000970&quot; MajorTopicYN=&quot;N&quot;&gt;Antineoplastic Agents&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000494&quot; MajorTopicYN=&quot;N&quot;&gt;pharmacology&lt;/QualifierName&gt;           &lt;QualifierName UI=&quot;Q000627&quot; MajorTopicYN=&quot;Y&quot;&gt;therapeutic use&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D002296&quot; MajorTopicYN=&quot;N&quot;&gt;Carcinosarcoma&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000188&quot; MajorTopicYN=&quot;Y&quot;&gt;drug therapy&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D003520&quot; MajorTopicYN=&quot;N&quot;&gt;Cyclophosphamide&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000031&quot; MajorTopicYN=&quot;Y&quot;&gt;analogs &amp;amp; derivatives&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D004353&quot; MajorTopicYN=&quot;N&quot;&gt;Drug Evaluation, Preclinical&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D004361&quot; MajorTopicYN=&quot;N&quot;&gt;Drug Tolerance&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D004906&quot; MajorTopicYN=&quot;N&quot;&gt;Erythrocyte Count&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D006863&quot; MajorTopicYN=&quot;N&quot;&gt;Hydrogen-Ion Concentration&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D006943&quot; MajorTopicYN=&quot;N&quot;&gt;Hyperglycemia&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D007069&quot; MajorTopicYN=&quot;Y&quot;&gt;Ifosfamide&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000494&quot; MajorTopicYN=&quot;N&quot;&gt;pharmacology&lt;/QualifierName&gt;           &lt;QualifierName UI=&quot;Q000627&quot; MajorTopicYN=&quot;N&quot;&gt;therapeutic use&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D007109&quot; MajorTopicYN=&quot;N&quot;&gt;Immunity&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000187&quot; MajorTopicYN=&quot;Y&quot;&gt;drug effects&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D007165&quot; MajorTopicYN=&quot;N&quot;&gt;Immunosuppression Therapy&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D007928&quot; MajorTopicYN=&quot;N&quot;&gt;Lethal Dose 50&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D007958&quot; MajorTopicYN=&quot;N&quot;&gt;Leukocyte Count&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D008297&quot; MajorTopicYN=&quot;N&quot;&gt;Male&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D051379&quot; MajorTopicYN=&quot;N&quot;&gt;Mice&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D009374&quot; MajorTopicYN=&quot;N&quot;&gt;Neoplasms, Experimental&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000188&quot; MajorTopicYN=&quot;N&quot;&gt;drug therapy&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D051381&quot; MajorTopicYN=&quot;N&quot;&gt;Rats&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D013268&quot; MajorTopicYN=&quot;N&quot;&gt;Stimulation, Chemical&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D013997&quot; MajorTopicYN=&quot;N&quot;&gt;Time Factors&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D014508&quot; MajorTopicYN=&quot;N&quot;&gt;Urea&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000031&quot; MajorTopicYN=&quot;Y&quot;&gt;analogs &amp;amp; derivatives&lt;/QualifierName&gt;           &lt;QualifierName UI=&quot;Q000494&quot; MajorTopicYN=&quot;N&quot;&gt;pharmacology&lt;/QualifierName&gt;           &lt;QualifierName UI=&quot;Q000627&quot; MajorTopicYN=&quot;N&quot;&gt;therapeutic use&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;       &lt;/MeshHeadingList&gt;
&lt;PMID Version=&quot;1&quot;&gt;23&lt;/PMID&gt;
&lt;ArticleTitle&gt;Effect of etafenone on total and regional myocardial blood flow.&lt;/ArticleTitle&gt;
&lt;Abstract&gt;           &lt;AbstractText&gt;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.&lt;/AbstractText&gt;         &lt;/Abstract&gt;
&lt;MeshHeadingList&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D000818&quot; MajorTopicYN=&quot;N&quot;&gt;Animals&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D001794&quot; MajorTopicYN=&quot;N&quot;&gt;Blood Pressure&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000187&quot; MajorTopicYN=&quot;N&quot;&gt;drug effects&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D002245&quot; MajorTopicYN=&quot;N&quot;&gt;Carbon Dioxide&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000097&quot; MajorTopicYN=&quot;N&quot;&gt;blood&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D002302&quot; MajorTopicYN=&quot;N&quot;&gt;Cardiac Output&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000187&quot; MajorTopicYN=&quot;N&quot;&gt;drug effects&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D003326&quot; MajorTopicYN=&quot;N&quot;&gt;Coronary Circulation&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000187&quot; MajorTopicYN=&quot;Y&quot;&gt;drug effects&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D003331&quot; MajorTopicYN=&quot;N&quot;&gt;Coronary Vessels&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000187&quot; MajorTopicYN=&quot;N&quot;&gt;drug effects&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D004285&quot; MajorTopicYN=&quot;N&quot;&gt;Dogs&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D006339&quot; MajorTopicYN=&quot;N&quot;&gt;Heart Rate&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000187&quot; MajorTopicYN=&quot;N&quot;&gt;drug effects&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D006346&quot; MajorTopicYN=&quot;N&quot;&gt;Heart Septum&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D006352&quot; MajorTopicYN=&quot;N&quot;&gt;Heart Ventricles&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D006863&quot; MajorTopicYN=&quot;N&quot;&gt;Hydrogen-Ion Concentration&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D000860&quot; MajorTopicYN=&quot;N&quot;&gt;Hypoxia&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000503&quot; MajorTopicYN=&quot;N&quot;&gt;physiopathology&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D010100&quot; MajorTopicYN=&quot;N&quot;&gt;Oxygen&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000097&quot; MajorTopicYN=&quot;N&quot;&gt;blood&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D011427&quot; MajorTopicYN=&quot;N&quot;&gt;Propiophenones&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000494&quot; MajorTopicYN=&quot;Y&quot;&gt;pharmacology&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D014665&quot; MajorTopicYN=&quot;N&quot;&gt;Vasodilator Agents&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000494&quot; MajorTopicYN=&quot;Y&quot;&gt;pharmacology&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;       &lt;/MeshHeadingList&gt;

答案1

得分: 0

使用 sed

$ sed -En &#39;/&lt;PMID|&gt;\[|&lt;Abstract/{N;/&gt;\[|&lt;Abstract|&lt;MeshHeadingList/p;}&#39; input_file
&lt;PMID Version=&quot;1&quot;&gt;21&lt;/PMID&gt;
&lt;ArticleTitle&gt;[关于甘菊成分的生化研究/III。关于(-)-α-比萨保罗(作者翻译)的体外抗胃酶活性的研究]。&lt;/ArticleTitle&gt;
&lt;Abstract&gt;           &lt;AbstractText&gt;(-)-α-比萨保罗的主要抗胃酶作用与剂量有关,不是由于pH值的改变引起的。加入比萨保罗与胃蛋白酶的比例为1/0.5,可以将胃蛋白酶的蛋白酶活性降低50%。比萨保罗的抗胃酶作用只有在直接接触的情况下才会发生。如果之前与底物接触,抑制作用就会丧失。&lt;/AbstractText&gt;         &lt;/Abstract&gt;
&lt;MeshHeadingList&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D004305&quot; MajorTopicYN=&quot;N&quot;&gt;剂量-反应关系,药物&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D006454&quot; MajorTopicYN=&quot;N&quot;&gt;血红蛋白&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000378&quot; MajorTopicYN=&quot;N&quot;&gt;代谢&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D006863&quot; MajorTopicYN=&quot;N&quot;&gt;氢离子浓度&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D066298&quot; MajorTopicYN=&quot;N&quot;&gt;体外技术&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D008722&quot; MajorTopicYN=&quot;N&quot;&gt;方法&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D010434&quot; MajorTopicYN=&quot;N&quot;&gt;胃蛋白酶A&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000037&quot; MajorTopicYN=&quot;Y&quot;&gt;拮抗剂和抑制剂&lt;/QualifierName&gt;           &lt;QualifierName UI=&quot;Q000378&quot; MajorTopicYN=&quot;N&quot;&gt;代谢&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D010946&quot; MajorTopicYN=&quot;N&quot;&gt;草药&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D012717&quot; MajorTopicYN=&quot;N&quot;&gt;倍半萜烯类化合物&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000494&quot; MajorTopicYN=&quot;Y&quot;&gt;药理学&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D013056&quot; MajorTopicYN=&quot;N&quot;&gt;紫外线分光光度法&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D014238&quot; MajorTopicYN=&quot;N&quot;&gt;三氯乙酸&lt;/DescriptorName&gt;         &lt;/MeshHeading&gt;         &lt;MeshHeading&gt;           &lt;DescriptorName UI=&quot;D014443&quot; MajorTopicYN=&quot;N&quot;&gt;酪氨酸&lt;/DescriptorName&gt;           &lt;QualifierName UI=&quot;Q000378&quot; MajorTopicYN=&quot;N&quot;&gt;代谢&lt;/QualifierName&gt;         &lt;/MeshHeading&gt;       &lt;/MeshHeadingList&gt;
&lt;PMID Version=&quot;1&quot;&gt;22&lt;/PMID&gt;
&lt;ArticleTitle&gt;[展示了一种具有强免疫刺激低分子质量物质的抑制肿瘤性质。与依福酰胺对易免疫性DS肉瘤的比较研究。通过BA 1(N-(2-氰乙烯)-尿素)大约20天的自身免疫活性刺激。新的预防可能性]。&lt;/ArticleTitle&gt;
&lt;Abstract&gt;           &lt;AbstractText&gt;报告了关于BA 1 [N-(2-氰乙烯)-尿素]在分子质量M = 111.104的低分子质量物质中出色的免疫特性的最新发现。对214只患有DS肉瘤的Wistar大鼠的实验表明,BA 1以仅约12%的LD50(150 mg/kg)剂量和可忽略的致死率(1.7%),可使康复率达到40%,不伴有高血糖,而在一次试验中,伴有高血糖的康复率可达80%。在其他条件不变的情况下,参考物质依福酰胺(IF
<details>
<summary>英文:</summary>
Using `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>


</details>
# 答案2
**得分**: 0
以下是翻译好的部分:

<PMID Version="1">22</PMID>
<ArticleTitle>[Demonstration of tumor inhibiting p
<Abstract> <AbstractText>A report is giv
<MeshHeadingList> <MeshHeading>

<PMID Version="1">23</PMID>
<ArticleTitle>Effect of etafenone on total and reg
<Abstract> <AbstractText>The distributio
<MeshHeadingList> <MeshHeading>


请注意,这是您提供的文本的翻译,不包括代码部分。
<details>
<summary>英文:</summary>
Assumptions:
- all lines start with one of four patterns: `&lt;PMID`, `&lt;ArticleTitle`, `&lt;Abstract` or `&lt;MeshHeadingList`
- each &#39;block&#39; of text will have no more than four lines, with each of the (previously mentioned) patterns occurring no more than once in a block
- only print (to stdout) those blocks that contain four lines (and thus contain each of the four patterns)
- the first line in a block will always start with `&lt;PMID`
Cutting the sample down to something a bit more manageable:
$ cut -c1-50 xgrep.txt &gt; xgrep.short.txt
$ cat xgrep.short.txt
&lt;PMID Version=&quot;1&quot;&gt;19&lt;/PMID&gt;                             # discard
&lt;ArticleTitle&gt;Antidepressant drugs affect dopamine      # discard
&lt;MeshHeadingList&gt;         &lt;MeshHeading&gt;                 # discard
&lt;PMID Version=&quot;1&quot;&gt;20&lt;/PMID&gt;                             # discard
&lt;ArticleTitle&gt;Aggregation of blood platelets by ad      # discard
&lt;MeshHeadingList&gt;         &lt;MeshHeading&gt;                 # discard
&lt;PMID Version=&quot;1&quot;&gt;22&lt;/PMID&gt;                             # keep
&lt;ArticleTitle&gt;[Demonstration of tumor inhibiting p      # keep
&lt;Abstract&gt;           &lt;AbstractText&gt;A report is giv      # keep
&lt;MeshHeadingList&gt;         &lt;MeshHeading&gt;                 # keep
&lt;PMID Version=&quot;1&quot;&gt;23&lt;/PMID&gt;                             # keep
&lt;ArticleTitle&gt;Effect of etafenone on total and reg      # keep
&lt;Abstract&gt;           &lt;AbstractText&gt;The distributio      # keep
&lt;MeshHeadingList&gt;         &lt;MeshHeading&gt;                 # keep
**NOTE:** comments and blank lines added for clarification; the comments and blank lines do not exist in the file (`xgrep.short.txt`)
One `awk` idea:
awk &#39;
function print_block() { 
if (linecnt==4)
print block
linecnt=0
block=&quot;&quot;
}
/^(&lt;PMID|&lt;ArticleTitle|&lt;Abstract|&lt;MeshHeading)/ { 
if ($0 ~ /^&lt;PMID/)                                 # flush previous block to stdout?
print_block()
linecnt++
block = block (block!=&quot;&quot; ? RS : &quot;&quot; ) $0
}
END  { print_block() }                                 # flush last block to stdout?
&#39; xgrep.short.txt
This generates:
&lt;PMID Version=&quot;1&quot;&gt;22&lt;/PMID&gt;
&lt;ArticleTitle&gt;[Demonstration of tumor inhibiting p
&lt;Abstract&gt;           &lt;AbstractText&gt;A report is giv
&lt;MeshHeadingList&gt;         &lt;MeshHeading&gt;
&lt;PMID Version=&quot;1&quot;&gt;23&lt;/PMID&gt;
&lt;ArticleTitle&gt;Effect of etafenone on total and reg
&lt;Abstract&gt;           &lt;AbstractText&gt;The distributio
&lt;MeshHeadingList&gt;         &lt;MeshHeading&gt;
**NOTE:** blank line added for readability; blank line is not part of actual output
</details>
# 答案3
**得分**: 0
这可能适用于你(GNU sed):
```shell
sed -n '/^<PMID/{:a;N;/^<MeshHeadingList/!ba;/^<Abstract>/Mp}' 文件名

使用选项-n来过滤文件,只打印以<PMID开头,以<MeshHeadingList结尾,同时包含以<Abstract>开头的行集合。

注:当匹配正则表达式时,M标志用于跨多行匹配,允许^$匹配行的开头和结尾。

英文:

This might work for you (GNU sed):

sed -n &#39;/^&lt;PMID/{:a;N;/^&lt;MeshHeadingList/M!ba;/^&lt;Abstract&gt;/Mp}&#39; file

Filter file using the option -n to print only the collection of lines that start with &lt;PMID and end with a line starting &lt;MeshHeadingList and contain a line starting &lt;Abstract&gt;.

N.B. The M flag when matching a regexp operates on multiple lines and allow the ^ and $ to match start and end of lines.

huangapple
  • 本文由 发表于 2023年2月24日 06:34:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/75551006.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定