Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Bash: Problem: Abschnitt aus einem Text herausfiltern

Empfohlene Antworten

Veröffentlicht

Hallo,

mein Problem, weil ich nicht genau weiß wie ich das mit grep und sed lösen kann:

Ich muss aus einer HTML Seite einen bestimmten Abschnitt herausfiltern. Es wird ein Keyword (hier ein Datum) vorgegeben und

es muss der darunter folgende Abschnitt bis zum nächsten Keyword herausgefiltert werden.

Hier mal Code um das zu verdeutlichen:

<html>

<head> </head>

<body>

<table>

<tr>

<td>

28.09.2007

</td>

</tr>

</table>

<p class="aatext">

<a href="irgendwas"> Text 1 </a>

</p>

<p class="aatext">

<a href="irgendwas"> Text 2 </a>

</p>

<p class="aatext">

<a href="irgendwas"> Text 3 </a>

</p>

<table>

<tr>

<td>

29.09.2007

</td>

</tr>

</table>

<p class="aatext">

<a href="irgendwas"> Text 4 </a>

</p>

<p class="aatext">

<a href="irgendwas"> Text 5 </a>

</p>

<p class="aatext">

<a href="irgendwas"> Text 6 </a>

</p>

</body>

</html>

Wenn der 28.09.2007 vorgegeben wird, dann muss Text 1, Text 2 und Text 3 ausgegeben werden.

Wie stelle ich das jetzt an? Bin für jede Hilfe dankbar.

Hinweis: Im GNU Grep gibt es das Flag -P nicht, was die Sache vereinfachen würde (nutze Ubuntu 7.10)

Mit freundlichen Grüßen

Basti, sebcon02@arcor.de

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.