[comp.unix.questions] conditional substitutes

andre@duttnph.tudelft.nl (Andre Verweij) (04/02/91)

I try to make a script for file conversion.
the input file looks like :

	Normal text, where comma's can appear.
	Label
	0	12,34
	2	1,23

The problem is that I want to have the comma's after the Label
be replaced with spaces. In vi you can do a search for Label, 
followed by .,$s/,/ /g but is this also possible in a shell script.
In awk there should be a way to have both spaces and comma's as a 
field seperator.

Who knows an easy solution ?

Andre

jik@athena.mit.edu (Jonathan I. Kamens) (04/08/91)

#!/bin/sed -f

/^Label$/,$s/,/ /g

Read sed(1) for more information.

-- 
Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik@Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8085			      Home: 617-782-0710