LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-30-2004, 07:35 AM   #1
datamarc
LQ Newbie
 
Registered: Jul 2004
Posts: 3

Rep: Reputation: 0
file size


I have a text file that is 1.4G in size. I need to be able to open this file and view the contents as well a search the contents for specific data. I currently receive a virtual memory file size error when attempting to open. Any ideas on how to open or how to cut it into smaller files, without opening, and open the smaller files? Also, any ideas on how to search the file for specific data, similar to "find" in Wordpad?
 
Old 12-30-2004, 07:38 AM   #2
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 36
use grep to search within a file

grep "word" filename

You can split the file into smaller ones.

Use the split command.

If it is a text file, you can specify how many lines to split it by.

example
split -l 2000 filename part_
you will have files then called
part_aa part_ab part_ac etc
 
Old 12-30-2004, 07:59 AM   #3
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 46
Re: file size

Quote:
Originally posted by datamarc
I have a text file that is 1.4G in size. I need to be able to open this file and view the contents as well a search the contents for specific data. I currently receive a virtual memory file size error when attempting to open. Any ideas on how to open or how to cut it into smaller files, without opening, and open the smaller files? Also, any ideas on how to search the file for specific data, similar to "find" in Wordpad?
hi there,

did you try "vi" ?

regards

slackie1000
 
Old 12-30-2004, 09:01 AM   #4
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
For splitting, look here: http://www.linuxquestions.org/questions/answers/227

As an editor I recommend Kate's find and replace (KDE).

You might want to enlarge your swap partition to the required size of <= 1.4 GB.
 
Old 12-30-2004, 11:28 AM   #5
NomadABC
Member
 
Registered: Dec 2004
Posts: 189

Rep: Reputation: 33
A text file of 1.4G. Somebody has been extremely busy!
 
Old 01-03-2005, 05:09 AM   #6
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
Quote:
Originally posted by NomadABC
A text file of 1.4G. Somebody has been extremely busy!
A noisy log file of a chattering daemon for example?

Last edited by JZL240I-U; 01-03-2005 at 05:10 AM.
 
Old 01-05-2005, 02:15 PM   #7
datamarc
LQ Newbie
 
Registered: Jul 2004
Posts: 3

Original Poster
Rep: Reputation: 0
file size

If I use the part_ process, will the original file remain as a single file, 1.4G, and the part_ process only create a copy of the partial file and not disrupt the original file?
 
Old 01-05-2005, 03:18 PM   #8
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 36
If I use the part_ process, will the original file remain as a single file, 1.4G, and the part_ process only create a copy of the partial file and not disrupt the original file?

yes, Your original file will be intact.

besides,
This would put it back together anyway.

for i in part_*
do
cat $i >> bigfile2
done
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I know the size of a file using C skie_knite007 Programming 3 04-04-2005 10:49 AM
when creating a *.iso file, how to make the file size smaller? minm Linux - Newbie 8 12-26-2004 09:58 PM
file system size larger than fysical size:superblock or partition table corrupt klizon Linux - General 0 06-18-2004 04:18 PM
How to get size of file in C Scrag Programming 5 05-20-2004 03:39 PM
get file size in C++ danxl Programming 3 11-18-2003 09:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration