i have a little problem, i have 3 txt file and i want to merge data into one csv with batch script
for exemple :
1.txt
Apple
Banana
Strawberry
2.txt
Red
Blue
Yellow
3.txt
One
Two
Three
What i want is a final.csv file with this sequence :
Apple;Red;One
Banana;Blue;Two
StrawberryYellow;Three
Can someone help me please ?
Thanks to everyone for answering me, I found another way that I will share with you in case someone needs it :
I used PowerShell to merge .csv files
here is the code : merge.ps1
#Import the CSVs
## GC = Get-Content
$csv1 = @(gc ".\1.csv")
$csv2 = @(gc ".\2.csv")
$csv3 = @(gc ".\3.csv")
# Create an Empty Array
$csv4 = @()
for ($i=0; $i -lt $csv1.Count; $i++) {
$csv4 += $csv1[$i] + ';' + $csv2[$i] + ';' + $csv3[$i]
}
# Output to file
$csv4 | Out-File ".\output.csv" -encoding default
# Delete the originals if you want
Remove-Item .\temp\1.csv
Remove-Item .\temp\2.csv
Remove-Item .\temp\3.csv
And in the batch script i have, i used this line to execute it : script.bat
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '.\merge.ps1'"