Pattern not found in vi

I've got a strange problem: When I grep for a pattern (e.g. 8980) I find it in a file. But when I search for it in vi (forward or backwards) it says 'Pattern not found'.

The pattern is not broken by a linebreak in the file.

What up with dat? It's driving me bonkers...
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kent OlsenData Warehouse Architect / DBACommented:
Hi newbie,

Can you post exactly what you're trying to run?

php-newbieAuthor Commented:
then either
Kent OlsenData Warehouse Architect / DBACommented:
If the string "8980" is in the file, either of those commands should search for the next/previous occurence.

Are you looking for the string "8980" or a 2 character string with a hex value of "8980"?

Also, is your terminal type set correctly?
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

php-newbieAuthor Commented:
Hi Kdo,

I can't find that string exactly when I ftp the file to windows and use a text editor to search.
I'm looking for the string 8980...
Hmm, terminal I don't set. Should I try a TERM=vt100?
But I don't see how vi would care about the terminal type?
php-newbieAuthor Commented:
sorry, my comment should say 'I can' find that string on windows...
Kent OlsenData Warehouse Architect / DBACommented:
Most terminal emulators are vt100 or ANSI.  If you're using either one and there is no odd behavior other than this it's unlikely that that is the problem.

How big is the file?  Can you dump it and examine the contents?

  od -xa filename

php-newbieAuthor Commented:
DOH! I missed that the vi editor opened with a message 'line too long' so it didn't load the full document

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.