English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Copy file /labs/data/cases.out to your pwd. Cases.out is a datafile that came from a database. It contains 5 fields. Each field is separated by a |. The first field is a case #, the second is an id #, the third is the persons name, the fourth and fifth field are the data opened/closed. If a field contains '**/**/**' then the case is either still open or has never been opened.

Use search and replace occurance of '**/**/**' to NEVER.

Im having moderate difficulty with this lab trying to preserve the formatting. Perhaps someone could be of help.

2007-02-15 06:26:03 · 5 answers · asked by wrongwaycc 1 in Computers & Internet Programming & Design

5 answers

s/

only does the line you're on

if you want to do the whole document, then enter command mode by hitting esc

:g/\*\*\/\*\*\/\*\*\//s//NEVER/g

if you mean the * to be wildcards, then remove the \ before each one, otherwise you need the \ to escape the wildcard functionality. Same as escaping the / as was mentioned above. The vi pocket reference guide from O'Reilly is also a good resoure. Less than $10.

2007-02-15 14:48:07 · answer #1 · answered by King Awesome 2 · 0 0

Try this site and see if it doesn't help any. Great source for VI commands.

http://www.ece.vill.edu/~doug/Unix/Vicommands/index.html

2007-02-15 06:38:00 · answer #2 · answered by Rick G 2 · 0 0

Good answers, but this could be done using sed much easier.

2007-02-16 17:21:28 · answer #3 · answered by Red S 1 · 0 0

using vi,

vi Cases.out

then type the following

:s/\*\*\/\*\*\/\*\*/NEVER/g

2007-02-15 06:41:29 · answer #4 · answered by fifty2weekhi 2 · 0 0

Try:

s/**\/**\/**/NEVER

You need to escape (\) your slashes.

2007-02-15 06:30:47 · answer #5 · answered by Jim Maryland 7 · 0 0

fedest.com, questions and answers