1846868 Members
3027 Online
110256 Solutions
New Discussion

vi search

 
SOLVED
Go to solution
j773303
Super Advisor

vi search

Below samle could find the "ab" and "AB"

vi test.log
---------------
abc
CAB
ddabccAB



/[A,a][B,b]
--------------------------------------
Is any conveient way to get ab and AB in vi ?
Due to [A,a[B,b] is typing take a long time.

Hero
5 REPLIES 5
Chris Wilshaw
Honored Contributor

Re: vi search

Sorry, as far as I know, the way you're already using it is the only way to perform such a search in vi (or ed)

One thing you could do is to create a new file as below;

cat FILE | tr '[:upper:]' '[:lower:]' > NEW_FILE

This converts all text in the file into lower case, meaning that you only then have to use /ab in vi to search.
Sanjay Kumar Suri
Honored Contributor

Re: vi search

Use the following : command

:ic (ignore case)

and then search with / or ?.

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
j773303
Super Advisor

Re: vi search

Pardon, can you say clearly?
what is :ic?? how to use in vi?
Thanks.
Hero
Sanjay Kumar Suri
Honored Contributor
Solution

Re: vi search

vi test.log

Press Esc then

:set ic

or

:set ignorecase

then search as per your needs.

sks

A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Ravi_8
Honored Contributor

Re: vi search

Hi

As Sanjay suri says, we can ignore the case while searching using / in vi
never give up