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.

Text nach Häufigkeit der Worte sortieren

Empfohlene Antworten

Veröffentlicht

Guten Morgen,

ich würde gerne einen Text nach der Häufigkeit der auftretenden Worte sortieren. Da ich auf diesem Gebiet bisher wenig Erfahrung habe , habe ich keinen richtigen Ansatz.Ich weiss das man dies mit "cat" und "sort" machen kann , allerdings nicht genau wie . Wäre für Hilfe sehr dankbar.

grüße

homer123

danks schön für die Antwort:)

ich habe das jetzt einmal so gemacht :

tr -sc 'a-zA-Z' '\012' < test.txt | sort | uniq -c | cat -n

angenommen in dem Text kommt einmal das Wort "Das" großgeschrieben und einmal "das" kleingeschrieben vor. Nun soll dies nicht als zwei Wörter, sondern als ein Wort aufgefasst werden. Geht das irgendwie

grüße

homer123

Eine Frage zwischendurch, die nicht unbedingt mit dem Thema zu tun hat: Waren solche Fragestellungen nicht der Grund dafür, dass so Ungetüme wie awk entwickelt worden sind, bzw. später dann PERL? Warum das nicht damit lösen, oder ganz einfach mit modernen Skriptsprachen wie Python oder Ruby? Vorallem, weil die -behaupte ich einmal stumpf- wesentlich schneller von der Laufzeit her sind, als die gute alte Bash.

Guten Morgen,

das mag sein , dass das auch einfacher geht , allerdings soll dies mit cat und sort gemacht werden.

lg

homer123

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

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.