Change file extension of file that don't have any in specific folders and subfolders without impacting files that already have extension

0

I extracted some .pst documents using readpst and I got as output loads of folders and subfolders in which,there are files without extension (the .msg one, but without the .msg at the end of the file) and other documents that have extension (I guess the attachments to the emails).

I tried to find a way to identify all the documents without an extension from the rest across all the subfolders and add a ".msg" at the end of it using Cygwin.

for file in; do [[ $file == . ]] && continue mv "$file" "${file}.msg" done

It did not work. I had another attempt with the explorer of windows. I could search all the file without extension using:

ext:[] NOT kind:folder

It lists them all, but here again, I couldn't have something to just do a .msg on them again. (If I cannot find a better solution, I will just copy paste those documents into a file and add .msg to all of them, but this would be sub-optimal.

user4926345

Posted 2019-08-05T08:43:18.973

Reputation: 21

No answers