Editors
Grepping with Vim
Of the many productivity-enhancing features that Vim has, one the the best for making similar changes to many files is grep, or vimgrep. This handy little tool will, from within vim, tell you how many files match your pattern, and then proceed to take you to each match, regardless of which file it occurs in. Sure, for straight /pattern/replacement/ text, there's nothing like sed -i, but if you've got to make changes which are similar or to similar areas but not the same, then vimgrep is your friend. To invoke this, you have two basic options. From the command line:
Shell Commands with Sed
Sed, that most useful of pattern replacement tools, can be used for much more than simple string replacements in text files. This article will examine the uses of Sed for creating commands and feeding them to the shell. This can be extremely useful, especially when working on file manipulations for large batches of files at a time. Let's say for example that you've got a directory full of files, and you'd like to move them into subdirectories according to the first three characters of the filenames. This is a one-liner with sed.
SED - Man Page
Updated: February 2006
Index
NAME
sed - stream editor for filtering and transforming textSYNOPSIS
sed [OPTION]...- Read more
- 50 reads
AWK - Man Page
Updated: Oct 19 2007
Index
NAME
gawk - pattern scanning and processing languageSYNOPSIS
gawk [ POSIX or GNU style options ] -f program-file [ -- ] file ...gawk [ POSIX or GNU style options ] [ -- ] program-text file ...
pgawk
[ POSIX or GNU style options ]
-f
program-file
[
--
] file ...
pgawk
[ POSIX or GNU style options ]
[
--
]
program-text
file ...
- Read more
- 48 reads


