I have a text file and I need to select a random line that contains more than 6 characters and no more than 10 characters. Normally I would use a script like this one that will work, but since it must be of a certain length, this will not work. Anyone have a solution?
An example input would be something like this:
Apple
Banana
Orange
Strawberry
Blueberry
Pineapple
Somelongfruithere
These values will be in the .txt file, each with a line break. An example of a string to be resolved is pineapple, but appleor Somelongfruitherewill not be resolved.
source
share