Blame test/rebuf.awk

Packit 575503
# From lole@epost.de Wed Sep  4 09:54:19 IDT 2002
Packit 575503
# Article: 14288 of comp.lang.awk
Packit 575503
# 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
Packit 575503
# From: LorenzAtWork <familie.lenhardt@epost.de>
Packit 575503
# Newsgroups: comp.lang.awk
Packit 575503
# Subject: bug in gawk 3.1.1?
Packit 575503
# Date: Wed, 28 Aug 2002 10:34:50 +0200
Packit 575503
# Lines: 45
Packit 575503
# Message-ID: <7g1pmukv07c56ep3qav3uebnipdaohqh2l@4ax.com>
Packit 575503
# Reply-To: lole@epost.de
Packit 575503
# NNTP-Posting-Host: 213.70.124.113
Packit 575503
# Mime-Version: 1.0
Packit 575503
# Content-Type: text/plain; charset=us-ascii
Packit 575503
# Content-Transfer-Encoding: 7bit
Packit 575503
# X-Trace: fu-berlin.de 1030523788 53278293 213.70.124.113 (16 [68559])
Packit 575503
# X-Newsreader: Forte Agent 1.91/32.564
Packit 575503
# Xref: dfw-artgen comp.lang.awk:14288
Packit 575503
# 
Packit 575503
# hello all,
Packit 575503
# 
Packit 575503
# I'm using the following script
Packit 575503
# 
Packit 575503
BEGIN {
Packit 575503
	RS="ti1\n(dwv,)?"
Packit 575503
	s = 0
Packit 575503
	i = 0
Packit 575503
}
Packit 575503
{
Packit 575503
	if ($1 != "")
Packit 575503
		s = $1
Packit 575503
	print ++i, s
Packit 575503
}
Packit 575503
# 
Packit 575503
# to extract values from a file of the form
Packit 575503
# 
Packit 575503
# ti1
Packit 575503
# dwv,98.22
Packit 575503
# ti1
Packit 575503
# dwv,103.08
Packit 575503
# ti1
Packit 575503
# ti1
Packit 575503
# dwv,196.25
Packit 575503
# ti1
Packit 575503
# dwv,210.62
Packit 575503
# ti1
Packit 575503
# dwv,223.53
Packit 575503
# 
Packit 575503
# The desired result for this example looks like
Packit 575503
# 
Packit 575503
# 1 0
Packit 575503
# 2 98.22
Packit 575503
# 3 103.08
Packit 575503
# 4 103.08
Packit 575503
# 5 196.25
Packit 575503
# 6 210.62
Packit 575503
# 7 223.53
Packit 575503
# 
Packit 575503
# The script work fine the most time, but when run on the attached file
Packit 575503
# (sorry for the size, but the error would not appear with less data) I
Packit 575503
# get some (three with the attached file) lines that look like
Packit 575503
# 
Packit 575503
# 1262 dwv,212.97
Packit 575503
# 1277 dwv,174.33
Packit 575503
# 1279 dwv,151.79
Packit 575503
# 
Packit 575503
# I can't think of a other reason for this than a bug in gawk!
Packit 575503
# 
Packit 575503
# I'm running gawk 3.1.1 on winnt 4.0
Packit 575503
# 
Packit 575503
# best regards
Packit 575503
#      Lorenz
Packit 575503
# 
Packit 575503
#