s.in.ascii

rww at ecos.unh.edu rww at ecos.unh.edu
Wed Feb 3 09:04:25 EST 1993


Hello nancy,

If I understand your question, you have a file with

	x | y | z

in them and want

	x # y # z

try the command

	sed 's/|/#/g' infile > outfile

an explanation

	sed is the command
	the ' ' are to isolate the sed command from the shell
	s is the switch command
	/|  is what to search for
	/#  is what to replace with
	/g  tells sed to replace all |'s found on each line not just
		the first one

	infile is you  x | y | z  file

	sed will write to standard output unless it is redirected

let me know if you have any questions

oops I just saw johnson's e-mail with a different approach

why awk when you can sed ???




More information about the grass-user mailing list