Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a file larger than 5 GB. Are there any programs/tools that will be able to open it and copy & paste the contents?

If not, can it be done by writing a program?


migration rejected from stackoverflow.com May 10 at 15:18

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as off-topic by Ƭᴇcʜιᴇ007, Tog, Indrek, Kevin Panko, random May 10 at 15:18

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking product, service, or learning material recommendations are off-topic because they become outdated quickly and attract opinion-based answers. Instead, describe your situation and the specific problem you're trying to solve. Share your research. Here are a few suggestions on how to properly ask this type of question." – random
If this question can be reworded to fit the rules in the help center, please edit the question.

What operating system? And yes, it can be done. –  Amy Nov 24 '11 at 4:51
Copy & paste? What part, exactly? If it's all of it, you can copy the file. –  minitech Nov 24 '11 at 4:52
Whats the Operating System ? The very fact that its created a 5gb file means that it support a large file. What error do you receive while trying to open the file ? –  Kevin Nov 24 '11 at 4:53
possible duplicate of Text editor to open big (giant, huge, large) text files –  Samuel Liew Nov 24 '11 at 5:03
possible duplicate of Is there a text editor for very big files? –  Ƭᴇcʜιᴇ007 May 9 at 18:01

2 Answers 2

If not, can it be done by writing a program?

Yes, it can be better to use this approach if the operation is something you will have to do often.

There are many scripting tools that are well suited to this sort of task. One of them is Perl. Perl is included in most Linux & Mac systems and available free for Windows

Example: "copy" all text between and including lines starting "Apple…" and "Orange…" from file1.txt and "paste" (actually append) it to the end of file2.txt

perl -ne "print if /^Apple/../^Orange/" file1.txt >> file2.txt

The above can be typed at a command prompt. The part between quotes is the program (or script).


If you only want to do is copy and paste or do some small edits then I suggest using linux/unix text processing tools such as grep, sed, tail etc. They can easily find relevant part of the file or can modify it.