Debian Codegraph @

test/rebuf.awk

raw
1 # From [email protected] Wed Sep 4 09:54:19 IDT 2002
2 # Article: 14288 of comp.lang.awk
3 # Path: iad-read.news.verio.net!dfw-artgen!iad-peer.news.verio.net!news.verio.net!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!213.70.124.113!not-for-mail
4 # From: LorenzAtWork <[email protected]>
5 # Newsgroups: comp.lang.awk
6 # Subject: bug in gawk 3.1.1?
7 # Date: Wed, 28 Aug 2002 10:34:50 +0200
8 # Lines: 45
9 # Message-ID: <[email protected]>
10 # Reply-To: [email protected]
11 # NNTP-Posting-Host: 213.70.124.113
12 # Mime-Version: 1.0
13 # Content-Type: text/plain; charset=us-ascii
14 # Content-Transfer-Encoding: 7bit
15 # X-Trace: fu-berlin.de 1030523788 53278293 213.70.124.113 (16 [68559])
16 # X-Newsreader: Forte Agent 1.91/32.564
17 # Xref: dfw-artgen comp.lang.awk:14288
18 #
19 # hello all,
20 #
21 # I'm using the following script
22 #
23 BEGIN {
24 RS="ti1\n(dwv,)?"
25 s = 0
26 i = 0
27 }
28 {
29 if ($1 != "")
30 s = $1
31 print ++i, s
32 }
33 #
34 # to extract values from a file of the form
35 #
36 # ti1
37 # dwv,98.22
38 # ti1
39 # dwv,103.08
40 # ti1
41 # ti1
42 # dwv,196.25
43 # ti1
44 # dwv,210.62
45 # ti1
46 # dwv,223.53
47 #
48 # The desired result for this example looks like
49 #
50 # 1 0
51 # 2 98.22
52 # 3 103.08
53 # 4 103.08
54 # 5 196.25
55 # 6 210.62
56 # 7 223.53
57 #
58 # The script work fine the most time, but when run on the attached file
59 # (sorry for the size, but the error would not appear with less data) I
60 # get some (three with the attached file) lines that look like
61 #
62 # 1262 dwv,212.97
63 # 1277 dwv,174.33
64 # 1279 dwv,151.79
65 #
66 # I can't think of a other reason for this than a bug in gawk!
67 #
68 # I'm running gawk 3.1.1 on winnt 4.0
69 #
70 # best regards
71 # Lorenz
72 #
73 #