Thanks for all you support, and regret for the confusion created, actually below code worked the desired output, I was required simplly the file name to be added at the beginning of each line item
Note that if an input file contains any empty lines (i.e., just a <newline> character), they will not appear in the output produced by the above command.
However, the command:
grep '^' *.txt > output
should do what was requested. (Note that if the input files are matched by the pattern *.txt , the output file must not also match that pattern unless it is located in a different directory so the input file pattern won't match the output file's pathname.