954,228 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Ctrl-A and pasting in vi editor

Helloo!

I have a .txt file with around 1000 lines in it - each line just has a number. What I want to do is to copy all 1000 lines and paste it into an excel sheet.

So, I went up to the first line, changed to visual mode, and used shift+g to select all lines. Then I used ctrl+insert to copy them and then I went to excel and pasted them - but, only 41 lines get pasted!! :(

Please help!!

chandini.david
Newbie Poster
14 posts since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

have you tried other programs?

my guess would be you are hitting a limit, it may be software or hardware. obviously if it is a limit in your hardware (memory), there is not much you can do, unless you can get it onto another computer.

sillyboy
Practically a Master Poster
686 posts since Mar 2007
Reputation Points: 85
Solved Threads: 64
 

Hmm... no, I don't think that's it. My lappy's brand new, and it's almost empty right now... Besides, 41 lines seems too much of a coincidence. That's exactly how many lines I see on the screen at a time. Also, I can copy 1000 lines of text from excel to other docs easily enough...

chandini.david
Newbie Poster
14 posts since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

This is a limitation by "What's on the screen", if you want to use the vi copy function you could do something like '1000y' to put it into the yp keyboard.

If you want to do this easier, you can use gvim, select all, then use the copy button on the toolbar, which should get rid of the per screen limitation, or you can just rename the file to .csv and open it in excel, it will automatically put all the values on the first column.

blud
Linux Reject
Staff Writer
830 posts since Apr 2004
Reputation Points: 154
Solved Threads: 20
 

Okay, thanks!!! :)

chandini.david
Newbie Poster
14 posts since Nov 2009
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: