0

<br />区切り記号を使用して次の HTML ベローからこれらのタグをすべて削除するにはどうすればよいですか。これは大きな HTML ファイルの一部にすぎません。また、区切り記号を使用して、html ファイル内の他のタグを削除したいと考えています。

<Education :<br />
<br />
- School-leaving exam type B, Zug<br />
- Basic course HSG<br />
- Business economist FH, HWV St. Gallen (1990)<br />
<br />
Professional development :<br />
<br />
- 1984-97 GESTIO Treuhand- und Verwaltungs AG, Zug (part time)<br />
- 1985-86 Financial administration Canton of St. Gallen<br />
- 1991-94 Gestinor Services AG, Zug<br />
- 1994-97 Revisuisse Price Waterhouse AG, Zug, Taxes and Law<br />
- 1997 Founding of Bohnet & Schlatter Treuhand AG<br />
<br />
Experience :<br />
<br />
- Tax consultation of legal and natural persons<br />
- Preparation of tax statements for legal and natural persons<br />
- Preparation of structural plans and execution of organizational processes<br />
- Management and support on responsibilities in finances and accounting.

前もって感謝します。

4

1 に答える 1

0

テキストの置換は基本的なことなので、ほとんどの人が自分のライブラリにハンドラーを持っています。たとえば、

on run -- example
    set theText to "<Education :<br />
<br />
- School-leaving exam type B, Zug<br />..."

    replaceTextInString_fromOldItem_toNewItem_(theText, "<br />", "")
end run


to replaceTextInString_fromOldItem_toNewItem_(someText, oldItem, newItem)
    (*
    replace all occurances of oldItem with newItem
        parameters -    someText [text]: the text containing the item(s) to change
                        oldItem [text]: the item to be replaced
                        newItem [text]: the item to replace with
        returns [text]: the text with the item(s) replaced
    *)
    set {tempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, oldItem}
    try
        set {pieces, AppleScript's text item delimiters} to {text items of someText, newItem}
        set {someText, AppleScript's text item delimiters} to {pieces as text, tempTID}
    on error errorMessage number errorNumber -- oops
        set AppleScript's text item delimiters to tempTID -- make sure TID's are reset
        error errorMessage number errorNumber -- pass on error
    end try

    return someText
end replaceTextInString_fromOldItem_toNewItem_

Snow Leopard と Lion では、置き換える項目のテキスト区切り文字 (この例では oldItem パラメーター) は項目のリストにすることができることに注意してください。

于 2012-04-21T00:16:23.150 に答える