# File Reader (Complex format) problem

**URL:** <https://forum.knime.com/t/file-reader-complex-format-problem/43962>\
**Category:** KNIME Analytics Platform\
**Created:** [June 9, 2022, 7:37am UTC](https://forum.knime.com/t/file-reader-complex-format-problem/43962 "2022-06-09T07:37:18Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [June 9, 2022, 9:41am UTC](https://forum.knime.com/t/file-reader-complex-format-problem/43962/4 "2022-06-09T09:41:14Z")

</div>

@Dalmatino16 with the help of the Counter Generation you could give the lines numbers.

> **[Counter Generation](https://hub.knime.com/knime/extensions/org.knime.features.datageneration/latest/org.knime.datageneration.counter.CounterGenerationNodeFactory)**
>
> This node adds a new column to an input data table which contains a counter. The minimum value and the step size of the counter can be adjusted. The input data…

Then you could use the [Rule engine](https://kni.me/n/zpGPAjDyExkFL2HB) to save the number of the line if a certain condition is met and store the line in a separate column (var\_start, var\_end). Then only keep those columns and use a [math node](https://kni.me/n/2fI5rIsFDCFPHc0R) to calculate the start and length. Then convert that into Flow Variables that you can then use to steer your File import.

A somewhat similar example:

> [@parsing hierarchical data](https://forum.knime.com/t/parsing-hierarchical-data/39997/4):
>
> @dvkumaraws2019 I gave it a try and hope I have covered all cases you mentioned.

You mabye could upload 3 or 4 examples with varying table starts that would represent your task. Then someone might have a look.

---

_[View the full topic](https://forum.knime.com/t/file-reader-complex-format-problem/43962)._
