How to replace a full column in vi
Hi
How do I replace a full collum (each row is not identical) in vi or How can I delete files older than a date Regards Asanka |
As for changing columns, if you don't have to do it in an editor, you can use awk instead. Awk was created for just this sort of task.
To delete files older than a certain time, first create a dummy file which represents that time. Code:
touch -t 200607191013.22 compared_time Code:
find . -not -newer compared_time -delete |
In vim, you can use Ctrl-v in order to select a column.
|
Since you're going about with vim, try using vitutor to get your hands working properly with vim!!
|
well you can select a whole column by:
Code:
<esc>v} |
Good old vi can replace a column (space separated) by a constant string like this:
Code:
:g/^\([^ ]*\) \([^ ]*\) \(.*\)$/s//\1 new_column_2 \3/ |
Hay guys thanks
Regards Asanka |
All times are GMT -5. The time now is 05:34 PM. |