I often have need to manipulate data formated as comma separated fields with each line being a separate data record. Sometimes I want to delete a field from the file. Say I want to delete the 7th item. Currently, I do this in several steps,

search for ^(.+?,){6} and replace with &b
search for ^(.+?,){7} and replace with &b
search for b.+b and replace with nothing

The first two steps simply surround the field I want to delete with a character not found in the file. This makes it trivial to delete the field I want deleted.

I am would like to know if there is a more efficient (fewer steps) way to achieve this with grep.

--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to