>>> Before: >>> *,WIRE HARNESS, [snip] >>> After: >>> *WIRE HARNESS,, [snip] >> While I'm not sure what transformation you *want* from this >> data, the following turns your *before* into your *after* >> form: >> >> :g/^,.*[^,],$/d >> >> with the exception of the weirdness where the first "*WIRE >> HARNESS," line grew an extra comma. [top-posting corrected to list standards] > It didn't "grow an extra comma" it just moved the one from > infront to behind the word. That is where the problem lies. > The Part Numbers (ones that consist of numbers and those that > consist of words, i.e. "WIRE HARNESS") need to be the first > column.
Well, if they all start with an asterisk in the first column, you may be able to use my first one to get rid of the unwanted data, and then take a second pass to recolumnize the remaining ones: :g/^\*/s/,\([^,]*\),/\1,, -tim PS: when sending messages to the list, inline replies are greatly preferred for clarity over top-posting's Jeopardy-style read. --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
