James, Sandy, On Monday 24 January 2005 13:58, James Knott wrote:
Randall R Schulz wrote:
...
man cut
Cut is limited in its ability to delineate fields. It can use fixed character positions or a specific field separator character, but not a multi-character pattern such as "cn=".
With a bit of manipulation, you can for example, select "=" as the first delimiter, then "," as the next. You'd cut on "=", selecting everything after the cut, then pipe through another cut, using "," and selecting everything before the cut. I did something like that a while ago.
What's the point of jumping through hoops with a limited tool when you have a more powerful one that will pay back the effort of understanding its operation with the ability to tackle a much wider range of tasks? We also went through this exercise a few months ago where it turned out that cut is not particularly fast by comparison with sed. Randall Schulz