<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://wiki.christiaan008.com/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.christiaan008.com/index.php?action=history&amp;feed=atom&amp;title=Dynamically_splitting_output_into_files_while_processing</id>
		<title>Dynamically splitting output into files while processing - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.christiaan008.com/index.php?action=history&amp;feed=atom&amp;title=Dynamically_splitting_output_into_files_while_processing"/>
		<link rel="alternate" type="text/html" href="https://wiki.christiaan008.com/index.php?title=Dynamically_splitting_output_into_files_while_processing&amp;action=history"/>
		<updated>2026-10-22T10:02:55Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.3</generator>

	<entry>
		<id>https://wiki.christiaan008.com/index.php?title=Dynamically_splitting_output_into_files_while_processing&amp;diff=26&amp;oldid=prev</id>
		<title>Christiaan008: Christiaan008 moved page Dynamic splitting output into files while processing to Dynamically splitting output into files while processing</title>
		<link rel="alternate" type="text/html" href="https://wiki.christiaan008.com/index.php?title=Dynamically_splitting_output_into_files_while_processing&amp;diff=26&amp;oldid=prev"/>
				<updated>2015-11-08T22:52:06Z</updated>
		
		<summary type="html">&lt;p&gt;Christiaan008 moved page &lt;a href=&quot;/index.php/Dynamic_splitting_output_into_files_while_processing&quot; class=&quot;mw-redirect&quot; title=&quot;Dynamic splitting output into files while processing&quot;&gt;Dynamic splitting output into files while processing&lt;/a&gt; to &lt;a href=&quot;/index.php/Dynamically_splitting_output_into_files_while_processing&quot; title=&quot;Dynamically splitting output into files while processing&quot;&gt;Dynamically splitting output into files while processing&lt;/a&gt;&lt;/p&gt;
&lt;table class=&#039;diff diff-contentalign-left&#039;&gt;
				&lt;tr style=&#039;vertical-align: top;&#039;&gt;
				&lt;td colspan=&#039;1&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&#039;1&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 22:52, 8 November 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&#039;2&#039; style=&#039;text-align: center;&#039;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Christiaan008</name></author>	</entry>

	<entry>
		<id>https://wiki.christiaan008.com/index.php?title=Dynamically_splitting_output_into_files_while_processing&amp;diff=25&amp;oldid=prev</id>
		<title>Christiaan008: Created page with &quot; &lt;pre&gt;#!/bin/bash  #The purpose of this script is to dynamically split the output of generated entries into different files  #Set the variable values before the while loop so...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.christiaan008.com/index.php?title=Dynamically_splitting_output_into_files_while_processing&amp;diff=25&amp;oldid=prev"/>
				<updated>2015-11-08T21:35:08Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot; &amp;lt;pre&amp;gt;#!/bin/bash  #The purpose of this script is to dynamically split the output of generated entries into different files  #Set the variable values before the while loop so...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#The purpose of this script is to dynamically split the output of generated entries into different files &lt;br /&gt;
#Set the variable values before the while loop so that there is some input&lt;br /&gt;
start=&amp;quot;0&amp;quot;&lt;br /&gt;
amount=&amp;quot;5&amp;quot; #The amount to use to split&lt;br /&gt;
begin=$(echo $start) #The first time this will be the start value&lt;br /&gt;
end=$(expr $amount - 1) #The first time this will be the amount minus 1 value&lt;br /&gt;
&lt;br /&gt;
#This loop will continue until the variable $start will hit 10&lt;br /&gt;
while [[ $start -lt 20 ]]&lt;br /&gt;
do&lt;br /&gt;
        #Check if the expected file exists (only necessary for the first run)&lt;br /&gt;
        if [[ -f  &amp;quot;numbers&amp;quot;$begin&amp;quot;_&amp;quot;$end&amp;quot;.txt&amp;quot; ]];&lt;br /&gt;
        then&lt;br /&gt;
                #Count the amount of lines in the current file&lt;br /&gt;
                lines=$(wc -l &amp;lt; &amp;quot;numbers&amp;quot;$begin&amp;quot;_&amp;quot;$end&amp;quot;.txt&amp;quot;)&lt;br /&gt;
        else&lt;br /&gt;
                lines=&amp;quot;0&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        #If the result of the amount of lines in the current file is less then the number that is set add the entry to the current file&lt;br /&gt;
        if [[ $lines -lt $amount ]]&lt;br /&gt;
        then&lt;br /&gt;
                echo $start &amp;gt;&amp;gt; &amp;quot;numbers&amp;quot;$begin&amp;quot;_&amp;quot;$end&amp;quot;.txt&amp;quot;&lt;br /&gt;
        #Else the amount of lines in the current file is more then the amount that is set in the value $amount&lt;br /&gt;
        else&lt;br /&gt;
                #Update the variables $begin and $end by adding the value of variable $amount&lt;br /&gt;
                begin=$(expr $begin + $amount)&lt;br /&gt;
                end=$(expr $end + $amount)&lt;br /&gt;
                #Add current entry to new file&lt;br /&gt;
                echo $start &amp;gt;&amp;gt; &amp;quot;numbers&amp;quot;$begin&amp;quot;_&amp;quot;$end&amp;quot;.txt&amp;quot;&lt;br /&gt;
        fi&lt;br /&gt;
&lt;br /&gt;
        #Update the variable $start by 1 otherwise the loop will run indefinitely&lt;br /&gt;
        start=$(expr $start + 1)&lt;br /&gt;
done&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Christiaan008</name></author>	</entry>

	</feed>