source: trunk/essentials/sys-apps/gawk/test/rebuf.awk

Last change on this file was 3076, checked in by bird, 18 years ago

gawk 3.1.5

File size: 1.6 KB
Line 
1# From lole@epost.de 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 <familie.lenhardt@epost.de>
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: <7g1pmukv07c56ep3qav3uebnipdaohqh2l@4ax.com>
10# Reply-To: lole@epost.de
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#
23BEGIN {
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#
Note: See TracBrowser for help on using the repository browser.