I have a file, which is formatted like this:
header line 1
header line 2
header line 3
line 1
line 2
line 3
...
I need to get Iterable<String>
with those lines (line 1
, line 2
, line 3
etc.), after the header. How to achieve that with the help of Cactoos? The header is separated by the blank line.
I was able to skip the header lines with this code:
new Skipped<>(
new SplitText(
new TextOf(this.path),
"\n"
),
4
);
Now how to map the Iterable<Text>
with the skipped header to the Iterable<String>
?
I'm trying to do it with this code, which doesn't work:
new Mapped<>(
new FuncOf<>(
input -> input.asString()
),
new Skipped<>(
new SplitText(
new UncheckedText(
new TextOf(
this.path
)
),
"\n"
),
4
)
);