1
I have a folder with several sub-folders containing several arquivos.SQL
I wonder if you have any command of cmd
to search and copy to a single file all my files .SQL
found.
I was able to do this only by exporting the filenames, but not their content.
Commando:
C:\Users\jefer\Desktop\Integracao>dir /s .sql > todos_scripts.sql
This command lists all the titles of the found files. I would like to copy and export the contents of the files below each other.
I would like to look for a solution of the type below, but using a dir
or find
and merging results for a single result.
Commando:
C:\Users\jefer\Desktop\Integracao>copy *.sql todos_scripts.sql
Another thing I thought was to unify two commands, but I suppose it’s not possible.
Wrong example:
dir /s .sql | copy *sql listao.sql
Read the Manual on how NOT to ask questions
– Solkarped
make a
foreach
in the contents of the generated file, for example:for %%f IN (todos_scripts.sql) do coloque-seu-comando-copy-aqui
, or because it does not make aforeach
and already runs the command instead of generating a file with the scripts?– Ricardo Pontual