如何從 Endnote 導出文件格式對字段進行排序,其中該行在地址中包含 GRAZ 作為第一行?

沃爾特·施拉邁爾

我有一個 Endote 導出文件,如下所示:

    %0 Journal Article
    %A Abu-Rous, M.
    %A Ingolic, E.
    %A Schuster, K. C.
    %D 2006
    %Z Cellulose
    Article
    CODEN: CELLE
    %+ Christian Doppler-Laboratory of Fibre and Textile Chemistry in Cellulosics, Institute of Texile Chemistry and Textile Physics, Leopold-Franzens-University Innsbruck, Hoechsterstrasse 73, A-6850 Dornbirn, Austria
    Research Institute for Electron Microscopy (FELMI), Technical University of Graz, A-8010 Graz, Austria
    Textile Innovation, Lenzing AG, A-4860 Lenzing, Austria
    Schuster, K.C.; Textile Innovation, , A-4860 Lenzing, Austria; email: [email protected]
    %~ Scopus
    %G English
    
    
    
    %0 Journal Article
    %P 5003-5011
    %! Ursolic acid from Trailliaedoxa gracilis induces apoptosis in medullary thyroid carcinoma cells
    %@ 17912997
    %R 10.3892/mmr.2015.4053
    %1 in_author_address; 
    %F 8
    %K Apoptosis
    Bioactive agents
    %Z Mol. Med. Rep.
    Article
    Chemicals/CAS: caspase 8; ursolic acid, 77-52-1; I kappa B kinase, 209902-66-9; Antineoplastic Agents, Phytogenic; Caspase 8; I-kappa B Kinase; IKBKG protein, human; Plant Extracts; Triterpenes; ursolic acid
    Tradenames: cpt, Sigma Aldrich; rotichrom, karlsruhe, Germany
    %+ Department of Pathophysiology and Immunology, Center of Molecular Medicine, Medical University of Graz, 31a Heinrichstrasse, Graz A, 8010, Austria
    Department of Biochemistry and Molecular Biology, Shanghai Medical School, Fudan University, Shanghai, 200433, China
    Department of Pharmacognosy, Institute of Pharmacy, Center of Molecular Biosciences, Leopold Franzens University of Innsbruck, Innsbruck A, 6010, Austria
    Core Unit of Biomedical Research, Division of Laboratory Animal Science and Genetics, Medical University of Vienna, Himberg A, 2325, Austria
    Research Institute for Electron Microscopy and Fine Structure Research, University of Technology Graz, Graz A, 8010, Austria
    Pfragner, R.; Department of Pathophysiology and Immunology, 31a Heinrichstrasse, Austria; email: [email protected]
    %~ Scopus C2 - 26151624
    %G English


    

%+開頭的字段包含作者地址,根據作者的作者地址(1 到 n 的關係)可以包含更多行。每個作者地址由換行符(換行符)分隔

現在我想問一下如何根據 GRAZ 在行中的行對這個字段進行排序。Graz 所在的這一行,它們應該是列表中的第一行。

有沒有辦法通過 bash 文本處理工具來做到這一點,或者需要我編寫一個 Delphi 的程序來訪問和導入尾註導出轉儲。

上面這個例子的輸出應該是

    %0 Journal Article
    %A Abu-Rous, M.
    %A Ingolic, E.
    %A Schuster, K. C.
    %D 2006
    %Z Cellulose
    Article
    CODEN: CELLE
    %+ Research Institute for Electron Microscopy (FELMI), Technical University of Graz, A-8010 Graz, Austria
    Christian Doppler-Laboratory of Fibre and Textile Chemistry in Cellulosics, Institute of Texile Chemistry and Textile Physics, Leopold-Franzens-University Innsbruck, Hoechsterstrasse 73, A-6850 Dornbirn, Austria
    Textile Innovation, Lenzing AG, A-4860 Lenzing, Austria
    Schuster, K.C.; Textile Innovation, , A-4860 Lenzing, Austria; email: [email protected]
    %~ Scopus
    %G English
    
    
    
    %0 Journal Article
    %P 5003-5011
    %! Ursolic acid from Trailliaedoxa gracilis induces apoptosis in medullary thyroid carcinoma cells
    %@ 17912997
    %R 10.3892/mmr.2015.4053
    %1 in_author_address; 
    %F 8
    %K Apoptosis
    Bioactive agents
    %Z Mol. Med. Rep.
    Article
    Chemicals/CAS: caspase 8; ursolic acid, 77-52-1; I kappa B kinase, 209902-66-9; Antineoplastic Agents, Phytogenic; Caspase 8; I-kappa B Kinase; IKBKG protein, human; Plant Extracts; Triterpenes; ursolic acid
    Tradenames: cpt, Sigma Aldrich; rotichrom, karlsruhe, Germany
    %+ Department of Pathophysiology and Immunology, Center of Molecular Medicine, Medical University of Graz, 31a Heinrichstrasse, Graz A, 8010, Austria
    Department of Biochemistry and Molecular Biology, Shanghai Medical School, Fudan University, Shanghai, 200433, China
    Department of Pharmacognosy, Institute of Pharmacy, Center of Molecular Biosciences, Leopold Franzens University of Innsbruck, Innsbruck A, 6010, Austria
    Core Unit of Biomedical Research, Division of Laboratory Animal Science and Genetics, Medical University of Vienna, Himberg A, 2325, Austria
    Research Institute for Electron Microscopy and Fine Structure Research, University of Technology Graz, Graz A, 8010, Austria
    Pfragner, R.; Department of Pathophysiology and Immunology, 31a Heinrichstrasse, Austria; email: [email protected]
    %~ Scopus C2 - 26151624
    %G English

我會很高興並感謝任何有趣的建議。

喬諾

請您嘗試以下操作:

#!/bin/bash

shopt -s nocasematch            # make the match case-insensitive

# print the arrays and empty them
flush() {
    printf "%s" "%+ "
    printf "%s\n" "${out1[@]}" "${out2[@]}"
    out1=(); out2=()
}

while IFS= read -r line; do     # read the file line by line
    if (( auth )); then         # now in the "Author Address" context
        if [[ $line = "%"* ]]; then
                                # end of the "Author Address" context
            auth=0
            flush               # print the arrays
            echo "$line"        # print current line
        else
            [[ $line = *"GRAZ"* ]] && out1+=("$line") || out2+=("$line")
                                # if the line contains "GRAZ" store it in the array out1, else out2
        fi
    else
        if [[ $line = "%+"* ]]; then
            auth=1              # enter in the "Author Address" context
            [[ $line = *"GRAZ"* ]] && out1+=("${line:3}") || out2+=("${line:3}")
                                # ${line:3} removes leading 3 characters
        else
            echo "$line"
        fi
    fi
done < input_file

輸出:

%1 Journal Article
%A Abu-Rous, M.
%A Ingolic, E.
%A Schuster, K. C.
%D 2006
%Z Cellulose
Article
CODEN: CELLE
%+ Research Institute for Electron Microscopy (FELMI), Technical University of Graz, A-8010 Graz, Austria
Christian Doppler-Laboratory of Fibre and Textile Chemistry in Cellulosics, Institute of Texile Chemistry and Textile Physics, Leopold-Franzens-University Innsbruck, Hoechsterstrasse 73, A-6850 Dornbirn, Austria
Textile Innovation, Lenzing AG, A-4860 Lenzing, Austria
Schuster, K.C.; Textile Innovation, , A-4860 Lenzing, Austria; email: [email protected]
%~ Scopus
%G English



%0 Journal Article
%P 5003-5011
%! Ursolic acid from Trailliaedoxa gracilis induces apoptosis in medullary thyroid carcinoma cells
%@ 17912997
%R 10.3892/mmr.2015.4053
%1 in_author_address;
%F 8
%K Apoptosis
Bioactive agents
%Z Mol. Med. Rep.
Article
Chemicals/CAS: caspase 8; ursolic acid, 77-52-1; I kappa B kinase, 209902-66-9; Antineoplastic Agents, Phytogenic; Caspase 8; I-kappa B Kinase; IKBKG protein, human; Plant Extracts; Triterpenes; ursolic acid
Tradenames: cpt, Sigma Aldrich; rotichrom, karlsruhe, Germany
%+ Department of Pathophysiology and Immunology, Center of Molecular Medicine, Medical University of Graz, 31a Heinrichstrasse, Graz A, 8010, Austria
Research Institute for Electron Microscopy and Fine Structure Research, University of Technology Graz, Graz A, 8010, Austria
Pfragner, R.; Department of Pathophysiology and Immunology, 31a Heinrichstrasse, Austria; email: [email protected]
Department of Biochemistry and Molecular Biology, Shanghai Medical School, Fudan University, Shanghai, 200433, China
Department of Pharmacognosy, Institute of Pharmacy, Center of Molecular Biosciences, Leopold Franzens University of Innsbruck, Innsbruck A, 6010, Austria
Core Unit of Biomedical Research, Division of Laboratory Animal Science and Genetics, Medical University of Vienna, Himberg A, 2325, Austria
%~ Scopus C2 - 26151624
%G English

輸出與您的預期輸出略有不同,一個是因為該... University of Technology Graz ...行比不包含GRAZ在您的預期結果中的其他行晚,另一個是因為medunigraz被認為是 match GRAZ

Dieser Artikel stammt aus dem Internet. Bitte geben Sie beim Nachdruck die Quelle an.

Bei Verstößen wenden Sie sich bitte [email protected] Löschen.

bearbeiten am
0

Lass mich ein paar Worte sagen

0Kommentare
LoginNach der Teilnahme an der Überprüfung

Verwandte Artikel

如何在 python 中操作 JSON 文件使第一列成為第一行?

如何為表格中的每一行製作一個接受按鈕?

我如何從 PHP 中的 pucture 製作最後一行?

將列表轉換為 DataFrame 如何刪除第一行中的前導 0

僅從行集中取第一行

如何在lua中將字符串作為一行代碼執行

如何使用 XSLT 從電子郵件地址中對值進行子串

如何從預定義的數據中對 mysql 進行排序

如何從以下數據字典中對時間戳進行排序?

如何從一個文件中隨機發送一行?

如何跳過讀取文件的第一行?

如何從Qt中的txt文件中刪除一行?

如何將數據合併為一行

如何從清單的輸出中刪除文本文件的一行

如何從 SQL Clickhouse 中的一行減去其他行

如何從 seqinr SeqFastadna 對象轉換為 Biostrings DNAStringSet 以在 R 中進行多序列比對

將 bash 變量從 if else 設置為一行

在 R 中滾動最大值。從第一行到當前行

如何對數字進行排序而不在 Python 中的下一行重複

如何根據自定義所需的順序對包含列表作為元素的數組列表進行排序

如何在一行中製作兩個下拉列表以進行反應?

從 CSV 文件讀取的字典中對結果進行排序

BASH 如何從每一行獲取最小值

Lua - 如何從 JSON 表(Google Sheets API)中提取一行數據?

如何添加多行標題,其中第一行居中,後續行左對齊?

從數據庫中檢索最後一個值 - 應該對結果進行排序嗎?

如何在我的頁面中間對我的 HTML 輸入進行排序/格式化,並將它們的標題排成一行?

如何從 UI 列表中選擇一個遊戲對象並對其進行處理

如何將導入導出添加到表中並在 django 中對列進行排序

TOP Liste

  1. 1

    Wie aktualisiere ich ein Feld in einer Raumdatenbank mit einem Repository und einem Ansichtsmodell?

  2. 2

    Wie füge ich mehrere Spalten in einer Spalte mit derselben Tabelle in SQL Server zusammen?

  3. 3

    Wie kann man Gitterquadrate dazu bringen, die Farbe zu ändern?

  4. 4

    Ich kann nicht verstehen, wie man Go-Code in mehreren Dateien kompiliert

  5. 5

    Zählen Sie die Vorkommen jedes Werts in einem Tupel in Python

  6. 6

    Gibt es eine sauberere Möglichkeit, Konstruktorargumente und Instanzeigenschaften einer Klasse in Typescript zu definieren?

  7. 7

    So implementieren Sie Pushwoosh mit ionic 2

  8. 8

    Wie wird der Wert im Dropdown-Menü basierend auf den ausgewählten Daten / IDs angezeigt?

  9. 9

    Tomcat - Leiten Sie den alten Kontextstamm zum neuen Kontextstamm um

  10. 10

    Ändern Sie den Knotenpfad in das aktuelle Verzeichnis

  11. 11

    So erstellen Sie ein Array von Objekten aus zwei Arrays von Objekten mit einem gemeinsamen Schlüssel - JavaScript

  12. 12

    Rufen Sie die ID aus der Datagrid-Ansicht ab und zeigen Sie die Daten in Textfeldern einem anderen Formular an

  13. 13

    base js: Wie füge ich einem Objekt eine Eigenschaft auf die 'alte' Weise hinzu?

  14. 14

    Ersetze einen Teil einer Zeichenfolge durch eine Pandas-Spalte als Muster

  15. 15

    Blättern Sie auf Radio Click zur Abschnitts-ID

  16. 16

    CBCentralManager wird nach dem Verbinden neu gestartet

  17. 17

    Scherz, wie man eine Funktion verspottet, die von einer verspotteten Funktion zurückgegeben wird

  18. 18

    django-allauth Empfängersignal zum Hinzufügen einer Gruppenberechtigung zum Benutzer bei der Anmeldung

  19. 19

    Tic Tac Toe-Spiel im React-Reset-Button funktioniert nicht

  20. 20

    AQL: Teilweise Übereinstimmung in einer Reihe von Zeichenfolgen

  21. 21

    So summieren Sie die Werte zweier Tabellen und gruppieren sie nach Datum

heißlabel

Archiv