I have a few thousand txt files and I need to insert the filename inside each one between <> on the second line. For example: I have lot of files like this
225248F040.txt
225248F060.txt
225248F070.txt
225446F020.txt...
Their content header:
%
(PROGRAM.....225248F040)
(PROGRAMMER.....NAME)
(DATE....... 28.APR.2022)
(TIME............. 10.26)
(MACHINE........DX250)
(================================)
I need to add the name between <> on the second line of each one, looking like this:
%
<225248F040.txt>
(PROGRAM.....225248F040)
(PROGRAMMER.....NAME)
(DATE....... 28.APR.2022)
(TIME............. 10.26)
(MACHINE........DX250)
(================================)
I can use CMD, Bash linux, Powershell or Python.