Thread Anzahl Zeilen in Textdatei ermitteln: (Wie mache ich das am schnellsten?) (34 answers)
Opened by Crian at 2004-04-21 11:58

Taulmarill
 2004-04-21 17:07
#81719 #81719
User since
2004-02-19
1750 Artikel
BenutzerIn

user image
[quote=sri,21.04.2004, 14:59]Ich dachte das mit den Globs und den Bienchen hätt ich dir neulich erklärt. :-P[/quote]
ne, hast du nich, aber wenn ich weiss dass das globs sind dann is mir schon geholfen, ich kann ja lesen :-)

btw. poor mans progress bar:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/perl -w

use strict;

$| = 1;

my $file = "test.txt";
my $maxsize = -s $file;
my $accsize = "0";
my $accperc = "0.0125";

print " 10%| 20%| 30%| 40%| 50%| 60%| 70%| 80%| 90%| 100%|\n";

open ( F, "<$file" ) or die $!;

while (<F>) {
$accsize += length $_;
if ( $accsize / $maxsize >= $accperc ) {
print "#";
$accperc += 0.0125;
}
# inserd your code here
}

print "\n";
$_=unpack"B*",~pack"H*",$_ and y&1|0& |#&&print"$_\n"for@.=qw BFA2F7C39139F45F78
0A28104594444504400 0A2F107D54447DE7800 0A2110453444450500 73CF1045138445F4800 0
F3EF2044E3D17DE 8A08A0451412411 F3CF207DF41C79E 820A20451412414 83E93C4513D17D2B

View full thread Anzahl Zeilen in Textdatei ermitteln: (Wie mache ich das am schnellsten?)