# The file is too big to be read by knime, is there any solution? Or measures

**URL:** <https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645>\
**Category:** KNIME Analytics Platform\
**Created:** [October 10, 2021, 1:26pm UTC](https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645 "2021-10-10T13:26:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![lichang](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/l/5f8ce5/32.png) [@lichang](https://forum.knime.com/u/lichang)\
**Post date:** [October 10, 2021, 1:26pm UTC](https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645/1 "2021-10-10T13:26:29Z")

</div>

What is read is TSV text (6.2GB).

thanks

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/3/5/359bca3b69f1e911c9ed9f9fe23907c61c2c6c97.png)

---

<div class="post-metadata">

**Author:** ![bruno29a](https://forum-cdn.knime.com/user_avatar/forum.knime.com/bruno29a/32/28802_2.png) [@bruno29a](https://forum.knime.com/u/bruno29a)\
**Post date:** [October 10, 2021, 1:35pm UTC](https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645/2 "2021-10-10T13:35:55Z")

</div>

Hi @lichang , what kind of error messages do you get? Can you share them?

Knime should be able to read any file size. It’s usually your system that would impose a limitation.

Also, how much memory have you assigned to Knime?

EDIT: If you can also explain a bit what you intend to do with the data, it may help to give you a more precise solution based on what you want to do.

---

<div class="post-metadata">

**Author:** ![lichang](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/l/5f8ce5/32.png) [@lichang](https://forum.knime.com/u/lichang)\
**Post date:** [October 12, 2021, 1:09pm UTC](https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645/3 "2021-10-12T13:09:48Z")

</div>

Thank you very much for your reply. I have been busy recently and did not reply in time. My memory was 8GB before, but after trying 32GB it still couldn’t run.  
I just want to simply read a piece of data that looks slightly larger, and I haven’t figured out what to do later.  
But I thought of a possible method, but I don’t know how to achieve it with knime. If you can help, I will be very grateful to you.

As shown in the screenshot I provided. KNIME can read a certain number of rows at a time for later analysis (for example, 50,000 rows each time), and iterate several times to finish reading, so that it will get rid of the memory limit to a certain extent.

---

<div class="post-metadata">

**Author:** ![bruno29a](https://forum-cdn.knime.com/user_avatar/forum.knime.com/bruno29a/32/28802_2.png) [@bruno29a](https://forum.knime.com/u/bruno29a)\
**Post date:** [October 12, 2021, 1:33pm UTC](https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645/4 "2021-10-12T13:33:41Z")

</div>

Hi @lichang , based on what you said, I’m assuming you are talking about your system’s memory, correct?

Did you increase the memory allocation to Knime though?

Check your knime.ini file. It’s located in the folder where you installed your Knime.

In the knime.ini file, look for the line that starts with `-Xmx`, and modify the values there. For example:  
`-Xmx4000m` assigns 4000 MB of RAM  
`-Xmx4g` assigns 4GB of RAM

In your case, you can assign 28-30GB, so change this line to:  
`-Xmx28g`

You may need to restart Knime after that so that the change takes into effect.

Try this and see if it works. Let us know what was the previous value.

---

<div class="post-metadata">

**Author:** ![Daniel\_Weikert](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/e47c2d/32.png) [@Daniel\_Weikert](https://forum.knime.com/u/Daniel_Weikert)\
**Post date:** [October 12, 2021, 6:05pm UTC](https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645/5 "2021-10-12T18:05:40Z")

</div>

Other option would include using Python and read the data in chunks

br

---

<div class="post-metadata">

**Author:** ![bruno29a](https://forum-cdn.knime.com/user_avatar/forum.knime.com/bruno29a/32/28802_2.png) [@bruno29a](https://forum.knime.com/u/bruno29a)\
**Post date:** [October 12, 2021, 6:24pm UTC](https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645/6 "2021-10-12T18:24:22Z")

</div>

Hi @Daniel_Weikert , Knime can read in chunks without Python 🙂

In the end, it will depend on what’s next. I mean if it’s just reading in chunks to then append to a table, it will come down to the same issue.

But if it’s reading in chunks and processing in chunks to somehow reduce the results, this may work.

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [October 12, 2021, 6:55pm UTC](https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645/7 "2021-10-12T18:55:22Z")

</div>

@lichang one thing you could try is use a local big data environment and copy the TSV file into the environment and use an external table. In theory Hive should be able to handle very large files. It might be possible to load and then convert / compress the file.

> [@File reader Node failing to access Large TEXT file containing 34 Millions records](https://forum.knime.com/t/file-reader-node-failing-to-access-large-text-file-containing-34-millions-records/28218/13):
>
> Is it possible that because of strange delimiters some lines get skipped? Another possibility is to try and use KNIME’s local big data engine and create an external table and see what this does. Other that that I would recommend trying to use the R package since this can handle a lot of import problems.

It might take some preparations to do that:

> **[This workflow demonstrates several methods to import one or many CSV file...](https://hub.knime.com/mlauber71/spaces/Public/kn_example_bigdata_hive_csv_external_table/m_001_import_hive_csv~AfawFAc72EvefbIH/current-state)**
>
> This workflow demonstrates several methods to import one or many CSV file into Hive Demonstrated are direct Uploads where you create a Hive table with KNIME no…

Do you have a small sample of the file that would have the very same structure as your large file and the same encoding?

The next thing to try would be to read the data in chunks and tell the [CSV Reader](https://hub.knime.com/knime/extensions/org.knime.features.base/latest/org.knime.base.node.io.filehandling.csv.reader.CSVTableReaderNodeFactory) to skip to line number n and only read x lines until the whole file has been imported. I am not sure if the reader internally would try to cache the whole thing or if it could handle such a task. The example is reading from a database but the loop might be adapted:

> **[Export huge MS sql table to csv without fetching all records together –...](https://hub.knime.com/mlauber71/spaces/Public/forum/kn_example_huge_db_to_csv/m_001_write_csv_41~eeeQpO-YFJ5EPfco/current-state)**
>
> The example attached uses ROWIDs from SQLite. You could see if you either have a ROWIDs present or you could create one yourself. You can choose the size of th…

And then you could see if the simple file reader or [file reader](https://hub.knime.com/knime/extensions/org.knime.features.base/latest/org.knime.base.node.io.filehandling.csv.reader.FileReaderNodeFactory) could handle the data.

> **[Simple File Reader Speedup Demonstration – knime](https://hub.knime.com/knime/spaces/Examples/01_Data_Access/01_Common_Type_Files/10_Simple_File_Reader_Speedup~pHJ52KL4w8mZrPYn/current-state)**
>
> This workflow demonstrates the speedup of the Simple File Reader node compared to the File Reader node.

In all these cases you might want to consider that once you have the data in a format that you can read and KNIME might be able to handle you will have to have enough resources to process the file. So you might have to use chunks of the data at once. Here are som additional hints about KNIME and performance:

> **[A meta collection about KNIME and performance and performance tuning and some...](https://hub.knime.com/mlauber71/spaces/Public/_knime_performance_and_tuning~iMkc4nou4_2G6OQM/current-state)**
>
> A meta collection about KNIME and performance and performance tuning and some problems Please be aware: there might not be the one perfect setting for every ta…

---

<div class="post-metadata">

**Author:** ![Daniel\_Weikert](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/e47c2d/32.png) [@Daniel\_Weikert](https://forum.knime.com/u/Daniel_Weikert)\
**Post date:** [October 13, 2021, 4:32pm UTC](https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645/8 "2021-10-13T16:32:17Z")

</div>

interesting,  
do you have a good sample link (sth free online) to download to test the big data environment. I do not have a file that big and I would like to test myself  
br

---

<div class="post-metadata">

**Author:** ![bruno29a](https://forum-cdn.knime.com/user_avatar/forum.knime.com/bruno29a/32/28802_2.png) [@bruno29a](https://forum.knime.com/u/bruno29a)\
**Post date:** [October 14, 2021, 12:13am UTC](https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645/9 "2021-10-14T00:13:32Z")

</div>

Hi @Daniel_Weikert , you could generate such a file via Knime using the Data Generator node.

> **[Data Generator](https://hub.knime.com/knime/extensions/org.knime.features.base/latest/org.knime.base.node.util.sampledata.SampleDataNodeFactory)**
>
> Creates random data containing some clusters for Parallel Universes. The data contains a certain fraction of noise patterns and data that is generated to clust…

You can generate millions of records using this node and you can then write it to a file.

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [October 14, 2021, 1:56am UTC](https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645/10 "2021-10-14T01:56:19Z")

</div>

@Daniel_Weikert you could use a data generator in a loop and append it to a CSV file. The [CSV writer](https://hub.knime.com/knime/extensions/org.knime.features.base/latest/org.knime.base.node.io.filehandling.csv.writer.CSVWriter2NodeFactory) has the ability to just append data. But be careful not to overload your hard drive 😊. Maybe do a rough estimation after a few loops

> **[Writing Files to Disk - compare speeds – mlauber71](https://hub.knime.com/mlauber71/spaces/Public/latest/kn_example_files_to_disk_compare_speed~vBauxxPWn875DLKW)**
>
> This workflow writes data set with 260.000 rows and 24 columns to Excel file in order to see writing speed. File is written in workflow directory in output fol…

---

<div class="post-metadata">

**Author:** ![Daniel\_Weikert](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/e47c2d/32.png) [@Daniel\_Weikert](https://forum.knime.com/u/Daniel_Weikert)\
**Post date:** [October 14, 2021, 5:12pm UTC](https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645/11 "2021-10-14T17:12:39Z")

</div>

Thanks for the idea  
br

---

<div class="post-metadata">

**Author:** ![lichang](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/l/5f8ce5/32.png) [@lichang](https://forum.knime.com/u/lichang)\
**Post date:** [October 22, 2021, 2:09am UTC](https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645/12 "2021-10-22T02:09:54Z")

</div>

Thank you all for providing a lot of ideas. But in terms of this idea, how should I edit the process

What I want to do is to divide a large file into small files. Each small file contains 100w lines of data. The premise is that knime cannot read the large file directly, only part of it.  
So how do you read 100w rows of data from a large file every time and write it into excel?  
The first time is the first 100w rows, the second time is the 100-200w rows, and so on. . .

br

---

<div class="post-metadata">

**Author:** ![Daniel\_Weikert](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/e47c2d/32.png) [@Daniel\_Weikert](https://forum.knime.com/u/Daniel_Weikert)\
**Post date:** [October 22, 2021, 2:46pm UTC](https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645/13 "2021-10-22T14:46:59Z")

</div>

Loops like Window Loop might help but I can see that Bruno is already typing a much more detailed solution which will certainly help you 🙂  
br

---

<div class="post-metadata">

**Author:** ![bruno29a](https://forum-cdn.knime.com/user_avatar/forum.knime.com/bruno29a/32/28802_2.png) [@bruno29a](https://forum.knime.com/u/bruno29a)\
**Post date:** [October 22, 2021, 2:49pm UTC](https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645/14 "2021-10-22T14:49:09Z")

</div>

> [@lichang](#):
>
> The premise is that knime cannot read the large file directly, only part of it.

As I said, Knime can open files with any size. It’s your system that is limiting it. There were a few questions and suggestions that were made regarding your memory allocation. Did you try them? You mentioned that you increased the size of memory of your system, but I then asked if you also increased the allocation of memory to Knime? With 32GB, you should easily be able to open a 6.2GB file.

> [@lichang](#):
>
> What I want to do is to divide a large file into small files.

Is that a requirement, or is this your workaround because you cannot open a big file? Try to assign the proper amount of memory to your Knime, it should work.

Regardless, it’s also good to know how to partially read a file. The Excel Reader allows you to read from a start row to an end row, so you can partially read an Excel file:

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/f/5/f5f0eb71d2210425f92698788b05f9a2ea3ff3fa.png)

The CSV Reader and the File Reader also both allow you to read a file partially by setting parameters in the Limit Rows tab:  
 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/8/c/8cbf50f992342d336c8510649119b734090f3778.png)

And of course, as always in Knime, any setting you can set manually can be controlled by a variable dynamically, and so for all these settings, you can set the values dynamically in the Flow Variables tab:

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/8/9/8902629c9953ff02e63ef8b08959bd17f83bd862.png)

I’m not sure what the “w” means in 100w or 200w (and by the way, if you do 100w rows, the second time it will be (100w+1) to 200w rows), but to keep it simple, let’s say we have a file containing 20 records and I want to read 5 lines at a time.

That means it should read:  
1: 1-5 rows  
2: 6-10 rows  
3: 11-15 rows  
4: 16-20 rows

Do you see a pattern here?  
Rows to read: 5  
Starting rows of every run: ((run-1) x 5) + 1

The good thing is that when you run this in a loop, Knime will give you what is the currentIteration is, and since iteration number starts with 0, in reality, this is what you will get:

```auto
Iteration | rows read
0 | 1-5
1 | 6-10
2 | 11-15
3 | 16-20

```

So, to get the starting row of each iteration, you can just use `($currentIteration$ * 5) + 1`, meaning if you want to know how many rows to skip for each iteration, it’s just `$currentIteration$ * 5`, of course where 5 is the number of rows you want to read, so in reality, the proper formula would be:  
Rows to skip: `$currentIteration$ * $rows_per_batch$`

---

<div class="post-metadata">

**Author:** ![bruno29a](https://forum-cdn.knime.com/user_avatar/forum.knime.com/bruno29a/32/28802_2.png) [@bruno29a](https://forum.knime.com/u/bruno29a)\
**Post date:** [October 22, 2021, 2:50pm UTC](https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645/15 "2021-10-22T14:50:32Z")

</div>

Thanks for the confidence @Daniel_Weikert lol 🤣

Regardless of the loop chosen or implemented, the partial read would still be done via the Limit rows 🙂

---

<div class="post-metadata">

**Author:** ![bruno29a](https://forum-cdn.knime.com/user_avatar/forum.knime.com/bruno29a/32/28802_2.png) [@bruno29a](https://forum.knime.com/u/bruno29a)\
**Post date:** [October 22, 2021, 3:31pm UTC](https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645/16 "2021-10-22T15:31:16Z")

</div>

One thing I’ve noticed though is that there does not seem a way to append to an Excel sheet.

You can write to the same Excel file, but in a new sheet. You can overwrite a sheet, but you cannot append to it.

I put something together quickly, but I’m writing to different sheets at the moment. Workflow looks like this:

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/9/9/991ff3949b6a8307df2bfad1b50509a93f053c3e.png)

Since we don’t know how many times we need to loop, I start with a Generic Loop Start, but I know I should stop once we have reached the end of the file, and we know that it is the last batch when the batch size is less than the number of rows per batch.

For a proper test, I add the iteration to the data.

A side note here: @ScottF , there seems to be a bug in the Constant Value Column. I tried adding knime’s currentIteration variable as an int:  
 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/c/0/c0d7af61a73bfca93c7956b90bf1d80a41861450.png)

it complains:  
 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/b/f/bf44a3ced62ec2b6418059267fb1e481a2e5e21a.png)

Somehow, it’s seeing the currentIteration variable as a String. It does not complain when I add it as a string:  
 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/a/e/aec644f494f11e10c6126ef7e0d5dfe58b4f6e4b.png)

==== END of Side Note ====

Continuing with the explanation, here’s what the Excel file looks like:

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/8/d/8d8b67507b722115488570c094e73bfe914dc9c5.png)

(So the Iteration was written as a string as you can see from the screenshot, because of what I explained in the Side note above)

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/8/8/88096450bf12fa59a9c663d5df45e11eebbe9501.png)  
 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/3/7/37ef461925a9f2f1741c730ea0bd4e055e1030bc.png)  
 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/9/c/9c4ebc1b63b7cc596ab1abe9806871d4e8d3d2de.png)

As you can see, it read only 5 rows each time.

If someone can point out how to append to the same sheet, that would be helpful.

In the mean time, here’s the workflow (sample file included, and it will write to the data folder): [CSV read only a few lines at a time.knwf](https://forum.knime.com/uploads/short-url/idsE5xghbWlFAWuAPVlnlIOdmOt.knwf) (26.8 KB)

---

<div class="post-metadata">

**Author:** ![lichang](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/l/5f8ce5/32.png) [@lichang](https://forum.knime.com/u/lichang)\
**Post date:** [October 23, 2021, 7:19am UTC](https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645/17 "2021-10-23T07:19:22Z")

</div>

thanks  
Best wishes to you and thank you for your continued response.  
It seems that the best way is to expand the memory.

br

---

<div class="post-metadata">

**Author:** ![lichang](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/l/5f8ce5/32.png) [@lichang](https://forum.knime.com/u/lichang)\
**Post date:** [October 23, 2021, 7:22am UTC](https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645/18 "2021-10-23T07:22:25Z")

</div>

And “w” is the first letter of Chinese “万（ten thousand）”

br

---

<div class="post-metadata">

**Author:** ![lichang](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/l/5f8ce5/32.png) [@lichang](https://forum.knime.com/u/lichang)\
**Post date:** [October 24, 2021, 3:22am UTC](https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645/19 "2021-10-24T03:22:16Z")

</div>

> [@lichang](#):
>
> 的方法是

I have applied the method mentioned, whether it is a loop or a read-only part, you need to have enough memory. This is the premise.

If a device is not capable of reading a large file completely, all methods seem to be ineffective.

Thanks again to everyone who helped.

br

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [October 25, 2021, 2:33pm UTC](https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645/20 "2021-10-25T14:33:36Z")

</div>

Hello @bruno29a,

seems Scott is successfully ignoring you 🙈

About your side node it’s a bit hard to believe you didn’t come across this issue/design yet. You can find explanation here (not only related to Constant Value Column node):

> [@Problem with Constant Value Column node](https://forum.knime.com/t/problem-with-constant-value-column-node/6698):
>
> Hello KNIME team, I have some problems adding an Integer type flow variable as a constant value column. Since&nbsp;a picture is worth a thousand words, please take a look at the attached screenshot as well as the correspondent&nbsp;workflow. Best, Marc [constantvaluecolumn01.png](https://www.knime.com/sites/default/files/constantvaluecolumn01.png)[bug\_-\_constant\_value\_column\_integer\_variable.zip](https://www.knime.com/sites/default/files/bug_-_constant_value_column_integer_variable.zip)

Br,  
Ivan

[Next page](https://forum.knime.com/t/the-file-is-too-big-to-be-read-by-knime-is-there-any-solution-or-measures/36645.md?page=2)
