Large text file edi...
 

  You don't need to be an 'investor' to invest in Singletrack: 6 days left: 95% of target - Find out more

[Closed] Large text file editor and/or splitter - Windows

16 Posts
11 Users
0 Reactions
108 Views
Posts: 0
Free Member
Topic starter
 

I have a largish text file (~700Mb) that i need to open and extract blocks of data from. Currently use Notepad++ which won't open it, so I need either:

- A (free!) large text file editor (I will happily accept it being a bit slow and clunky as I should have to use it only infrequently)
- A (Er, again, free!!) text file splitter. Again, doesn't have to be clever - simply splitting it in half would be fine, I can manipulate the data I need easily enough from there.

Anyone suggest anything? Ta in advance....


 
Posted : 13/02/2012 11:57 am
Posts: 12072
Full Member
 

Learn ruby or perl, that kind of thing is easypeasy. Or if you've got access to a unix box, head -<number of lines> > cut_file.txt would do it, too.


 
Posted : 13/02/2012 12:03 pm
Posts: 0
Free Member
Topic starter
 

Learn ruby or perl, that kind of thing is easypeasy

Probably true - lets assume I want to do this today, and conceivably may never get myself into this mess again 😉

Or if you've got access to a unix box

Hmmm..... we will have a Unix machine landing in about a week, which is about a week too late.

Any other suggestions?


 
Posted : 13/02/2012 12:08 pm
Posts: 9
Free Member
 

textpad? Not sure if can handle that sort of size, but its free. Works ok with our CDR files.


 
Posted : 13/02/2012 12:09 pm
Posts: 2
Free Member
 

Put it in a database? Have you got MS Access?


 
Posted : 13/02/2012 12:11 pm
Posts: 0
Free Member
Topic starter
 

textpad? Not sure if can handle that sort of size, but its free.
Pretty sure not based on a bit of googling. I have tried LFT Viewer, which will handle the size no probs, but is only a VIEWER and I will need to copy multiple large blocks of data out of it once opened.


 
Posted : 13/02/2012 12:12 pm
Posts: 0
Free Member
Topic starter
 

Rich - not a bad shout that - don't have Access as part of our Office install though. Grr....


 
Posted : 13/02/2012 12:13 pm
Posts: 0
Free Member
 

How about:

http://www.gdgsoft.com/gsplit/


 
Posted : 13/02/2012 12:16 pm
Posts: 12072
Full Member
 

1. Download "UnxUpdates.zip" from http://unxutils.sourceforge.net/
2. Expand the zip somewhere
3. Open cmd.exe
4. c:\somewhere\split.exe my_really_big_file.log

This will create n 1000 line files in the same directory - use the -l option to change the file size.

4. c:\somewhere\split.exe -l 10000 my_really_big_file.log

Edit: 100% free.
Edit2: Windows.


 
Posted : 13/02/2012 12:17 pm
Posts: 0
Free Member
Topic starter
 

Lemonysam/mogrim - many thanks. Looks like both those solutions will do the same thing/are ideal. Thanks again.


 
Posted : 13/02/2012 12:21 pm
Posts: 1080
Free Member
 

Mogrim's suggestion looks good. You could also try [url= http://www.ultraedit.com/downloads/ultraedit_download.html ]Ultraedit's free trial[/url] (normally costs $60) if it's just for today.


 
Posted : 13/02/2012 12:22 pm
Posts: 28
Free Member
 

1. Install perl.

2. Put the stuff below ---- in a text file textfilesplitter.pl.

3. Run textfilesplitter.pl and follow instructions.

-----------------------

# use warnings;

################################################################################
# #
# VARIABLES #
# #
################################################################################

# name of the input file - set by cmd line argument or via user prompt
$inputfile = $ARGV[0];

# no lines to split file on - set by cmd line argument or via user prompt
$nolines = $ARGV[1];

# used for incrementing the name of the ouptut file
$fileext = 1;

################################################################################
# #
# MAIN #
# #
################################################################################

if ( $ARGV[0] eq "" || $ARGV[1] eq "" ) {
print "This program splits a text file on a set number of lines\nPlease enter the name of the file:\n\n";
chomp ( $inputfile = <STDIN> );
print "\n\nPlease enter the number of lines to split on:\n\n";
chomp ( $nolines = <STDIN> );
}

open ( INPUT , "<$inputfile" ) || die "cannot open input file: $inputfile : $!\n\n";
open ( OUTPUT , ">$inputfile.$fileext" ) || die "cannot open output file : $inputfile.$fileext : $!\n\n";

while ( <INPUT> ) {
print OUTPUT;
$count++;
if ($count == $nolines ) {
close ( OUTPUT );
$totalcount = $totalcount + $count;
print "Total lines processed: $totalcount\n\n";
$fileext++;
open ( OUTPUT , ">$inputfile.$fileext" ) || die "cannot open output file : $inputfile.$fileext : $!\n\n";
print "writing data to $inputfile.$fileext\n\n";
undef $count;
}
}
close ( OUTPUT );
close ( INPUT );
$totalcount = $totalcount + $count;
print "Total lines processed: $totalcount\n\n";


 
Posted : 13/02/2012 12:24 pm
Posts: 0
Full Member
 

Tried Emacs? There is a Windows port.


 
Posted : 13/02/2012 12:27 pm
Posts: 0
Free Member
Topic starter
 

All done now - gsplit did it fine.

I did see the Windows port for Emacs..... but (as with the Perl solution) I don't really want to spend more than 5 mins on this as the data manipulation is where the effort is at..... and there is - inevitably - a deadline on it.

Thanks again all.


 
Posted : 13/02/2012 12:31 pm
Posts: 5686
Full Member
 

Other editors may exist - but this is infinitely better named: [url= http://www.brothersoft.com/chainsaw-8796.html ]CHAINSAW!!!!!![/url]


 
Posted : 13/02/2012 12:34 pm
Posts: 5182
Full Member
 

My go-to for straightforward viewing (usually a big logfile I need to se the end of) is [url= http://www.baremetalsoft.com/baretail/ ]Baretail[/url]. Blazing fast as it only shows you the bit of the file you're actually looking at.


 
Posted : 13/02/2012 12:51 pm
Posts: 0
Free Member
 

get textpad, should do it.
And if you buy a licence you also get wildedit which is a pretty powerful editor


 
Posted : 13/02/2012 12:53 pm

6 DAYS LEFT
We are currently at 95% of our target!