Article 5CKV2 For multiple csv files how do I add the value of one particular entry in any given csv to that csv's name?

For multiple csv files how do I add the value of one particular entry in any given csv to that csv's name?

by
sean mckinney
from LinuxQuestions.org on (#5CKV2)
This relates to the same files, drone flight logs, as an earlier question, if needed see https://www.linuxquestions.org/quest...nd-4175686948/.
I have a folder containing 800+ large csv's.
For each csv I would like to add the value of a particular entry ( the first 'sensible' or useful entry in a given column) to the name of that csv.

It seems there are two usual routes, one is to move or copy the file to somewhere else and add the amendment as part of the new name during the move/copy, I do not particularly want to do that as it is making a copy of a copy etc. which then has to be moved back to the original location so it becomes an even 'weaker' copy.
The other route is to use the "rename" command.

I can imagine doing either inside a awk or gawk script but am struggling to see how to give rename etc. the name of the original file 'inside' the script and as to how the script will cope with trying to change the name of a file that the script itself may be holding open.

Thanks for any assistance.latest?d=yIl2AUoC8zA latest?i=h5P-wjt2nmw:bDEJZWb9yg0:F7zBnMy latest?i=h5P-wjt2nmw:bDEJZWb9yg0:V_sGLiP latest?d=qj6IDK7rITs latest?i=h5P-wjt2nmw:bDEJZWb9yg0:gIN9vFwh5P-wjt2nmw
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments