How can I copy all files whose names begin with "stat" (there are approximately 500 files of type stat1.txt stat2.txt ..)? I think it will be necessary to use regular expressions. It would be nice if the code was on QT.

Closed due to the fact that the essence of the question is not clear to the participants Sergey Gornostaev , freim , LFC , 0xdb , Enikeyschik February 11 at 8:23 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • See filesystem and regex - cpp questions
  • Is this a one-time action? If yes, then readdir () + strstr () is easier - NewView
  • @NewView One time share? - Roar RaizZer

1 answer 1

QtIterator'om bypass the directory and collect the necessary files. (You can use QFile or QFileInfo to work with the current file.)