I am trying to read strings from a text file, but I want to limit each line according to a particular size. For example;
Here is my representing the file.
You will need to read all the data anyhow. Not much you can do apart from mapping each line and trim it.
rdd.map(line => line.take(3)).collect()