<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Текстовый файл 4 Гб]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=18028&amp;type=atom" />
	<updated>2023-12-10T11:26:58Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=18028</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Текстовый файл 4 Гб]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=159695#p159695" />
			<content type="html"><![CDATA[<p><strong>ypppu</strong> Перевод строки (не знаю `n или `r`n уже удалил исходный файл). Файл качал с интернета и сам не знал как данные разбиты. Для этого пришлось поделить 4 гб файл на на части по 10 мб ч/з total comander чтобы посмотреть по какому разделителю ориентироваться.</p>]]></content>
			<author>
				<name><![CDATA[ppss42]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41305</uri>
			</author>
			<updated>2023-12-10T11:26:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=159695#p159695</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Текстовый файл 4 Гб]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=159694#p159694" />
			<content type="html"><![CDATA[<p>Вопрос решил вроде, воспользовался помощью ChatGPT. Запустил скрипт и на выходе получил около 4700 файлов. Выборочно проверил, результат устроил. </p><div class="codebox"><pre><code>File := FileOpen(&quot;C:\bigFile.txt&quot;, &quot;r&quot;)
if !File
{
    MsgBox Файл не может быть открыт!
    ExitApp
}

Buffer := &quot;&quot;

while !File.AtEOF()
{
    Fragment := File.Read(800000) ; Читаем фрагмент размером 500000 символов
    Buffer := Buffer . Fragment     ; Добавляем фрагмент в буфер

    ; Проверяем наличие символа перехода на новую строку
    Index := InStr(Buffer, &quot;`n&quot;)
	
    while Index
    {
        Line := SubStr(Buffer, 1, Index-1) ; Получаем строку из буфера
        Buffer := SubStr(Buffer, Index+1)  ; Обновляем буфер, удаляя прочитанную строку
		count++
      ;  MsgBox % &quot;Строка: &quot; . Line
		tooltip, %count%
		FileAppend, %Line%, C:\результат\%count%.txt
		; Проверяем остаток буфера на наличие еще одной строки
        Index := InStr(Buffer, &quot;`n&quot;)
    }
}

; Обрабатываем последний остаток в буфере
if Buffer != &quot;&quot;
{
    MsgBox % &quot;Строка: &quot; . Buffer
}
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[ppss42]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41305</uri>
			</author>
			<updated>2023-12-10T11:21:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=159694#p159694</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Текстовый файл 4 Гб]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=159693#p159693" />
			<content type="html"><![CDATA[<p>А что Вы называете строкой?</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2023-12-10T11:18:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=159693#p159693</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Текстовый файл 4 Гб]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=159691#p159691" />
			<content type="html"><![CDATA[<p>Здравствуйте, есть файл 4 гб текстовый. Нужно разбить на несколько файлов. Один файл = одна строка. Пробовал через FileReadLine, но каждая строка длинной примерно 600 тыс. символов. Есть ли возможность использовать другой метод? Также читал про FileOpen, можно побайтово вроде считывать часть файла, но как это сделать, не знаю.</p>]]></content>
			<author>
				<name><![CDATA[ppss42]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41305</uri>
			</author>
			<updated>2023-12-10T09:48:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=159691#p159691</id>
		</entry>
</feed>
