Discussion Locked

Partial loading of a text file

0 helpful
8 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

We have a text file that is 24mb in size. It will take too long to load it (view it) in Word/Wordpad. Is there a utility out there that can partially load a text file maybe based on size - like 500 kb, or maybe split it into equal sizes of 500 kb. Basically, we just want to be able to view the first 500 kb of the file without having to open and load the whole 24 mb.
Thanks.

8 replies

by computerdude

An old DOS based version of Norton Editor will do exactly that. It only loads a small portion of the file. May not be elegant but works. I am sure a web search of text editors will turn up some shareware that will do it also.

Dave

by dlw6

Another trick you might try is with Quick View, which is part of a default install of NT (and Win9X for that matter).

In NT Explorer, right-click the file and select Quick View. It will show you the file contents, and it won't bother to load theentire file unless you try to scroll down.

Quick View has no editing capability, which I guess is why it's quick. It might meet your needs.

Good fortune,
Don

by jwildwind

As an alternative, I have a script that will chop up large files into small ones if you are interested. You'll need WSH loaded or VB to run it.
______________________________________

' Large Text File into Multiple Files

Const SmallFileSize = 524288
Const ForReading = 1
Const ForWriting = 2

Set fso = CreateObject("Scripting.FileSystemObject")

Set LargeFile = fso.OpenTextFile("C:\largefilenamegoeshere.txt", ForReading)

i = 1
Do While Not LargeFile.AtEndOfStream
Set SmallFile = fso.OpenTextFile("C:\smfile" & i & ".txt",

ForWriting, True)
SmallFile.Write LargeFile.Read(SmallFileSize)
SmallFile.Close
Set SmallFile = Nothing
i = i + 1
Loop

LargeFile.Close
_____________________________________

Windows Scripting Host is a MS freebie and is a great tool to have for a beginning script writer. If you're running Windows 2000 it's already built in.

Change C:\largefilenamegoeshere.txt to the filename and path of your large file, save the code as lrg2sm.vbs and run it.

by jwildwind

I don't know what happened but ...

Set SmallFile = fso.OpenTextFile("C:\smfile" & i & ".txt", ForWriting, True)

should be 1 line of code....

This discussion is closed to new replies.