# Open file in folder and subfolders

**URL:** <https://discourse.processing.org/t/open-file-in-folder-and-subfolders/17552>\
**Category:** Coding Questions\
**Created:** [February 4, 2020, 6:08pm UTC](https://discourse.processing.org/t/open-file-in-folder-and-subfolders/17552 "2020-02-04T18:08:47Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [February 5, 2020, 5:43pm UTC](https://discourse.processing.org/t/open-file-in-folder-and-subfolders/17552/4 "2020-02-05T17:43:50Z")

</div>

> [@plux](#):
>
> **loadStrings()** and BufferedWriter or using the Table class?

Well, **loadTable()** automatically parses CSV & TSV files for us:

> **[loadTable() / Reference](https://processing.org/reference/loadTable_.html)**
>
> Reads the contents of a file or URL and creates a Table object with its values. If a file is specified, it must be located in the sketch's "data" folder. The filename parameter can also be a URL to a …

And by using the Table class we have access to useful methods such as **getRowCount()**:

> **[getRowCount() / Reference](https://processing.org/reference/Table_getRowCount_.html)**
>
> Returns the total number of rows in a Table.

So you can find out the Table w/ the least number of rows.

Then afterwards, invoke **setRowCount()** on all 400+ Table containers, so they’ll all have the same number of rows:  
[Processing.GitHub.io/processing-javadocs/core/processing/data/Table.html#setRowCount-int-](http://Processing.GitHub.io/processing-javadocs/core/processing/data/Table.html#setRowCount-int-)

And finally, use **saveTable()** on each trimmed down Table:

> **[saveTable() / Reference](https://processing.org/reference/saveTable_.html)**
>
> Writes the contents of a Table object to a file. By default, this file is saved to the sketch's folder. This folder is opened by selecting "Show Sketch Folder" from the "Sketch" menu. Alter…

---

_[View the full topic](https://discourse.processing.org/t/open-file-in-folder-and-subfolders/17552)._
