I have a file Sample_20210805_009.txt file with data-
ID|Date|Marks|Age|Status|ContactNo
1|11:25:08|56.76|22|Pass|8787
So I want to develop a script run.sh which will create an output file with name "output.20210805.class.txt" (So the name of output file should be taken from sample files date i.e., Sample_20210805_009.txt - "20210805". And output in that file should be-
NAME SET <GAIN A> D5.MARKS[05AUG2021] = 56.76
NAME SET <GAIN A> D5.AGE[05AUG2021] = 22
NAME SET <GAIN A> D5.STATUS[05AUG2021] = PASS
NAME SET <GAIN A> D5.CONTACTNO[05AUG2021] = 8787
NAME SET <GAIN A> D5.CLASS[05AUG2021] = "10"
In this output file the last line and the content upto D5. would same. Also the date generating after each object should be automatic on the basis of given file name i.e., 20210805 so date is [05AUG2021]. Can anyone please help?