IT

약 2GB의 텍스트 파일을 어떻게 읽습니까?

lottoking 2020. 6. 6. 21:11
반응형

약 2GB의 텍스트 파일을 어떻게 읽습니까? [복제]


이 질문에는 이미 답변이 있습니다.

메모리가 2GB 이상인 .txt 파일이 있습니다. 문제는 메모장, 메모장 ++ 또는 다른 편집기 프로그램으로 열 수 없다는 것입니다.

어떤 솔루션?


글 로그를 사용해보십시오 . 빠르고 스마트 한 로그 탐색기.

2GB 크기의 로그 파일을 열었 으며 검색 속도도 매우 빠릅니다 .


워드 패드는 크기에 상관없이 모든 텍스트 파일을 엽니 다. 그러나 텍스트 편집기와 비교하여 기능이 제한되어 있습니다.


전체 파일을로드 / 읽는 대신 도구를 사용 하여 텍스트 파일을 더 작은 청크분할 할 수 있습니다 . Linux를 사용하는 경우 split명령을 사용할 수 있습니다 ( 이 stackoverflow 스레드 참조 ). Windows의 경우 HJSplit 과 같은 여러 도구가 있습니다 ( 이 수퍼 유저 스레드 참조 ).


UltraEdit을 사용하여 큰 파일을 편집합니다. UltraEdit으로 여는 최대 크기는 약 2.5GB입니다. 또한 UltraEdit에는 메모장 ++과 비교하여 좋은 16 진수 편집기가 있습니다.


엠 에디터는 저에게 아주 잘 작동합니다. 쉐어웨어 IIRC이지만 라이센스가 만료 된 후에도 작동이 중지되지 않습니다.


나는 항상 010 편집기사용 하여 큰 파일을 엽니 다. 2GB를 쉽게 처리 할 수 ​​있습니다. 010 Editor로 50GB의 파일을 조작했습니다 :-)

현재 상용이지만 시험판이 있습니다.


파일을 읽기만하면 큰 텍스트 파일 뷰어를 제안 할 수 있습니다. https://www.portablefreeware.com/?id=693

또한 이것을 참조하십시오

큰 (거대한, 거대한, 큰) 텍스트 파일을 여는 텍스트 편집기

당신이 당신의 자신의 도구를 시도하고 싶다면 그렇지 않으면. C #에서 파일 스트림 리더를 알고 있다고 가정합니다.

const int kilobyte = 1024;
const int megabyte = 1024 * kilobyte;
const int gigabyte = 1024 * megabyte;

public void ReadAndProcessLargeFile(string theFilename, long whereToStartReading = 0)
{
    FileStream fileStream = new FileStream(theFilename, FileMode.Open, FileAccess.Read);
    using (fileStream)
    {
        byte[] buffer = new byte[gigabyte];
        fileStream.Seek(whereToStartReading, SeekOrigin.Begin);
        int bytesRead = fileStream.Read(buffer, 0, buffer.Length);
        while(bytesRead > 0)
        {
            ProcessChunk(buffer, bytesRead);
            bytesRead = fileStream.Read(buffer, 0, buffer.Length);
        }
    }
}

private void ProcessChunk(byte[] buffer, int bytesRead)
{
    // Do the processing here
}

친절하게 참조

http://www.codeproject.com/Questions/543821/ReadplusBytesplusfromplusplusarinplusBinaryplusfilepl


시도 , 이맥스 (32 비트 모드에서 컴파일하는 경우 낮은 최대 버퍼 크기 제한을 갖는), 육각 공구


There are quite number of tools available for viewing large files. http://download.cnet.com/Large-Text-File-Viewer/3000-2379_4-90541.html This for instance. However, I was successful with larger files viewing in Visual studio. Thought it took some time to load, it worked.


For reading and editing, Geany for Windows is another good option. I've run in to limit issues with Notepad++, but not yet with Geany.

참고URL : https://stackoverflow.com/questions/18208524/how-do-i-read-a-text-file-of-about-2-gb

반응형