Unix copy paste long lines

Dear experts
I have a Log file and it has close to 5000 lines
The lines are really long and using the mouse is not an option.
I would like to  copy a line and paste it in windows notepad.
Any idea how I can do that?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

Easiest way would be to transfer the log to Windows and open it directly.

Is a file transfer possible?
Are they individual lines, or one long line in the file?

If you do "wc -l < filename" do you get a line number count?

If so, you could use vi to position to the line you want, then yank it to another file.
royjaydAuthor Commented:
hi thanks
>>wc -l < filename
i get 500 which is the number of lines i have in my file.
i am trying to copy-paste like this
i open the file
$vi filename
i place the cursor on the first letter of the line which i want to copy
i then type    yyp
to copy it and go to word doc and paste it but doesnt seem to paste it.

am i doing it correctly?
From the command mode, press : and then input the line numbers, w, and the file name.
The following example copies lines 40 to 50 to a new file newfile:

:40,50w newfile

This appends to newfile:

:40,50w>> newfile

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
In vi, the "yyp" duplicates a line but does not place it in the system clipboard, it just uses an internal buffer. Try doing instead:


That's using a register named + that is supposed to be attached to the system clipboard. It's not in traditional vi, but if your system has "vim" (or has "vi" aliased to "vim), it might work. Alas, I couldn't get it to work in my setup here, so I don't know if you'll have better luck. It seems to depend on whether the method you're using to access the UNIX/Linux session has the proper integration with the system clipboard. When it works, it's by far the easiest way to do this. Everything else involves more steps.
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
Unix OS

From novice to tech pro — start learning today.