Re: [Pyparsing] Check for tabs
Brought to you by:
ptmcg
From: Diez B. R. <de...@we...> - 2013-10-28 20:58:01
|
> > I'm new to pyparsing and relatively new to Python as well. I'm really astounded by the multitude of functionality that pyparsing has. > My question is pretty basic: > I have a string 'name\tdate\t\tlocation'. > What would I do to ensure that between the 'name' and 'date' there is exactly one tab and between 'date' and 'location' there is exactly two tabs? If that's all you have, I would forego pyparsing and use single string-functions like name, date, _, location = line.split("\t") plus of course some error-handling. Diez |