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.

zeilen zwischen dateien kopieren

Empfohlene Antworten

Veröffentlicht

hallo,

möchte gern aus datei1.ps alle zeilen unterhalb von "%%Page: 1 1" bis zum ersten vorkommen von "gsave" in die datei2.ps unterhalb von "%%Page: 1 1" kopieren.

mit welchen unix-befehlen erledige ich das am besten?

hatte schon die idee mit und

grep -n "%%Page:" datei1.ps | sed 's/:.*//' | head -n 1
und
grep -n "gsave" datei1.ps | sed 's/:.*//' | head -n 1

die zeilen zu ermitteln, komme jetz aber nicht weiter....

Bearbeitet von kale_1990

und hier die lösung:

datei1.ps -> quelldatei

datei2.ps -> zieldatei

tmp.ps -> temporaere datei


bs=$(grep -n "%%Page:" datei1.ps | sed 's/:.*//' | head -n 1)

es=$(grep -n "gsave" datei1.ps | sed 's/:.*//' | head -n 1)

bt=$(grep -n "%%Page:" datei2.ps | sed 's/:.*//' | head -n 1)


bs=$[$bs+1]

es=$[$es-1]



cat datei2.ps | head -n $bt > tmp.ps

cat datei1.ps | sed -n ${bs},${es}p >> tmp.ps


bt=$[$bt+1]

cat datei2.ps | tail +$bt >> tmp.ps


cp tmp.ps datei2.ps

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.