Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Any easier way of parsing this file?
- X-seq: zsh-users 9521
 
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
 
- To: DervishD <zsh@xxxxxxxxxxxx>, Zsh Users <zsh-users@xxxxxxxxxx>
 
- Subject: Re: Any easier way of parsing this file?
 
- Date: Wed, 19 Oct 2005 01:58:10 +0000
 
- In-reply-to: <20051018225336.GA957@DervishD>
 
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
 
- References: <20051018225336.GA957@DervishD>
 
On Oct 19, 12:53am, DervishD wrote:
}
}     The file contents are contained in a parameter (long story...),
} and they MUST be contained in a parameter.
} 
}     Is there any better way of parsing this file using Zsh and
} assuming that I may be interested in gathering the information for
} other labels in the future?
Use IFS.  That's what it's for.
	print -r $data | while IFS='=' read label content
	do
	    case $label in
	    SOMELABEL) : ... $content ... ;;
	    ANOTHERLABEL) : ... $content ... ;;
	    esac
	done
Messages sorted by:
Reverse Date,
Date,
Thread,
Author