Hi ,
I want to rename multiple files with their first line bar the first character + the extension .qual. For the example below the filename should read
7180000000987.qual. I have trawled through different threads for 2 days and I don't seem to find anything I can adopt for this task
you are supposed to read up to gain knowledge in the first place. Also, renaming files, reading files are so common that its just not possible not to find it here.. Note you can't really find exactly solutions to your problems because all problems are different but i am sure you can find similar ones....
that said, if you are using bash, for one file
read line < "filename"
newfilename=${line/>/}
mv "filename" "$newfilename"
It is probably good practice to validate your read from the file prior to doing the move, checking for things like spaces and nulls in the new name. Also check if the new file exists before doing the move. It would be easy to end up with 1 file called: -