![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX and Linux Applications Questions involving software not covered by other forum go here. This includes Databases and Middleware. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Comma seperator | premar | Shell Programming and Scripting | 6 | 02-17-2006 12:16 AM |
| sed utility to replace /307 with comma | obedkhan | UNIX for Dummies Questions & Answers | 1 | 02-06-2006 07:24 PM |
| Replace , (comma) with space | mbarberis | Shell Programming and Scripting | 6 | 03-29-2005 07:35 AM |
| add comma | alisevA3 | UNIX for Dummies Questions & Answers | 3 | 10-18-2002 06:29 AM |
| Add a comma at end of every line | ST2000 | Shell Programming and Scripting | 4 | 07-14-2002 03:49 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
vi or vim replace ,$ (eol) with just a comma
I have lines in a file like this (140,000+ entries):
value1, value2, value3, " " I want to concatenate the three (there are 22) lines with commas so it looks like this value1, value2, value3 " " I'm trying with :g/,$/s/,$/, /g but that is not flying. any ideas? Thanks, Dan |
| Forum Sponsor | ||
|
|
|
|||
|
Re: vi or vim replace ,$ (eol) with just a comma
Weeellllll, ok MS Word lets you replace comma + ^013 which takes a comma plus the carriage returns/line feeds/^M and leave just the comma and concatenates any line which had previously a comma (or any other character) and a new line. Sure takes a long time, and much CPU. At least it works.
Would still like to know how to do this in vi or vim, as I remember needing this before. Thanks, Dan |