I am able to get data if i have one line output but need help to modify the analysis to an extent that it can pull up data from multiple lines if available in output file.
I’m not sure I fully understand what you are trying to achieve? Are you trying to re-order the ‘fields’ that are returned?
That said, the reason your relevance returned “Singular expression refers to non-unique object” is that in its current form, you’ll have to pluralize ‘preceding texts’ and ‘firsts’ like so:
preceding texts of firsts "," of lines of files whose ...