Dear visitor, welcome to VDR Portal. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
|
|
Source code |
1 2 3 4 5 |
# cat Sieben/2005-11-05.22.07.50.99.rec/info.vdr C T-8468-769-16403 T Sieben S Sieben D Die Detectives David Mills und William Somerset jagen einen ebenso grausamen wie raffinierten Rit... |
Quoted
Original von Hulk
Ich bin mir nicht sicher ob es legitim ist einfach per grep die Zeile die mit "D" beginnen zu verwenden, da daduch Zeilen mit Zeilenumbrüchen verloren gehen könnten.
|
|
Source code |
1 |
grep ^D info.vdr | cut -d " " -f 2- | tr '|' '\n' |
Quoted
Original von Greywolf
Siehe man 5 vdr ... Zeilenumbrüche innerhalb der Beschreibung werden durch "|" ersetzt,
This post has been edited 2 times, last edit by "Hulk" (Nov 8th 2005, 3:41pm)
|
|
Source code |
1 |
grep -iv ^C info.vdr | grep -iv ^T | sed -e 's/^S //g' -e 's/^D /\n/g' -e 's/|/\n/g' > summary.vdr |
|
|
Source code |
1 |
$ cat info.vdr | sed -e 's/^D.*/&1|Test/g' |
|
|
Source code |
1 2 3 |
#!/bin/bash export FOOBAR="Test" cat info.vdr | sed -e "s/^D.*/&1$FOOBAR/g" |
|
|
PHP Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
#!/usr/bin/perl -w
$infofile = $ARGV[0] || die "please provide a file info.vdr\n";
$add = $ARGV[1] || die "nothing to add\n";
open(F, $infofile) || die "$infofile: $!\n";
while (<F>) {
if ($_ =~ /^D/sg) { # Bei Übereinstimmung
chomp $_; # Zeilenumbruch entfernen
print $_; # Originalwert
print $add; # Angefügtes
print "\n"; # Zeilenumbruch wieder anfügen
}
else {
print $_;
}
}
|
|
|
Source code |
1 |
$ ./test.pl "info.vdr" "Aufnahme von foobar42" > new-info.vdr |