Batch Copy dans DOS
Résolu/Fermé
A voir également:
- Batch Copy dans DOS
- Fichier batch - Guide
- Super copy - Télécharger - Gestion de fichiers
- Copy trans - Télécharger - Sonneries
- Copy trans heic - Télécharger - Visionnage & Diaporama
- Carbon copy cloner mac gratuit - Télécharger - Sauvegarde
2 réponses
dubcek
Messages postés
18718
Date d'inscription
lundi 15 janvier 2007
Statut
Contributeur
Dernière intervention
22 mars 2024
5 615
24 nov. 2009 à 12:20
24 nov. 2009 à 12:20
hello
tu peux faire
copy header.txt+a*.txt a1_head.txt
tu peux faire
copy header.txt+a*.txt a1_head.txt
dubcek
Messages postés
18718
Date d'inscription
lundi 15 janvier 2007
Statut
Contributeur
Dernière intervention
22 mars 2024
5 615
24 nov. 2009 à 14:56
24 nov. 2009 à 14:56
alors il faut faire une boucle, l'echo devant le copy va afficher ce qu'il ferait, l'enlever pour exécuter
@echo off
setlocal enableDelayedExpansion
for %%a in (a*.txt) do (
rem N prend le nom du fichier sans l'extension, a1, a2, ...
set N=%%~na
echo copy header.txt+%%a !N!_header.txt)
@echo off
setlocal enableDelayedExpansion
for %%a in (a*.txt) do (
rem N prend le nom du fichier sans l'extension, a1, a2, ...
set N=%%~na
echo copy header.txt+%%a !N!_header.txt)
24 nov. 2009 à 14:43
Mais dans ce cas, il me concatène tous mes fichiers donc il me crée un fichier qui est une concaténation de header, a1, a2, ...
Moi je voudrais avoir à chaque fois
- un ficher qui s'appellerait , qui serait une concaténation de et de ,
- un autre fichier qui s'appellerait , qui serait une concaténation de et de ,
- etc.
24 nov. 2009 à 16:13
for %i in (a*.txt) do copy header.txt+%i %ih
J'obtiendrai alors des fichiers a1.txth, a2.txth, etc qu'il suffira de renomer en .txt