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.

NR einen Wert zuweisen

Empfohlene Antworten

Veröffentlicht

Hallo liebes Forum,

ich hänge einfach fest bei einem ziemlich dummen Problem udn hoffe, dass ihr mir diesen Thread verzeiht. Aber ich kriege es einfach nicht hin.

Ich habe tonnenweise Dateien mit einem Namen wie clear_*.ill, deren Inhalt sind 56 Zeilen:

clear_01_01_12 286.070998

317.298085

363.381098

383.392224

386.121974

373.427115

345.287062
Mein Skript sieht so aus:
for i in clear_*.ill

do	

    cat $i |awk '{

        if (NR==1) {

            printf("%s %s ", $1, $2) >> "3_erg_ill_clear.dat"

            }        

        a==2

        for (NR==a;a<56;a++){

            printf("%s ", $1) >> "3_erg_ill_clear.dat"

            }

        if (NR==56) {

            printf("%s\n", $1) >> "3_erg_ill_clear.dat"

            }

	}'

done
Was apssieren sollte ist folgendes: Ich möchte eigentlich nur den Inhalt der jeweiligen Zeilen in der *.ill-Datei hintereinander in eine Zeile schreiben, sodass der Output so aussieht:
clear_01_01_12 286.070998 317.298085 363.381098 383.392224 386.121974 373.427115 345.287062
Leider sieht aber mein Output so aus:
clear_01_01_12 286.070998 clear_01_01_12 clear_01_01_12 clear_01_01_12 clear_01_01_12 clear_01_01_12 clear_01_01_12

Und ich ahbe schon so viele Varianten ausprobiert auch mit eine While-Schleife, aber bekomme es einfach nicht hin, NR einen Wert zuzuweisen. Er übergibt ja nur noch die ersten Zeilen.

Hat jemand eine Idee? Und nochmals Entschuldigung für die blöde Frage. Manchmal hat man irgendwie Tomaten auf den Augen...

Danke, Sandra

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.