New Posts  All Forums:Forum Nav:

Simple batch file

post #1 of 6
Thread Starter 
Hello all,

I currently merge 2 .csv files in to 1 with CMD. I use the following command line:


cd C:\Users\----\Foldername\----\etc----
C:\Users\----\Foldername\----\etc---- copy *.csv all-groups.csv

With this command I merge all the data from .csv files into 1. Is it possible to create a batch file so that I can just 1 click to execute the command line in place of typing it?

Kind regards
Rocket Science
(14 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600K 4.8GHz Asus Sabertooth P67 2x 6950 2GB CrossFire G.Skill 8GB 
Hard DriveOSPowerCase
Intel 510 250GB+Samsung 1TB Windows 7 64bit Corsair HX850W NZXT Phantom 
Audio
Sony RF865RK 
  hide details  
Reply
Rocket Science
(14 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600K 4.8GHz Asus Sabertooth P67 2x 6950 2GB CrossFire G.Skill 8GB 
Hard DriveOSPowerCase
Intel 510 250GB+Samsung 1TB Windows 7 64bit Corsair HX850W NZXT Phantom 
Audio
Sony RF865RK 
  hide details  
Reply
post #2 of 6
Code:
@echo off
copy *.csv all-groups.csv

Save it as merge-csv.bat, or whatever you like. Drop it in the folder that contains the CVS files and double click it.
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
Ol' Sandy
(28 items)
 
"Zeus"
(12 items)
 
Elite Preview
(6 items)
 
CPUMotherboardGraphicsRAM
Intel Xeon E3-1230v3 Gigabyte GA-Z97X-UD5H-BK MSI Gaming GTX 980 Kingston 32GB (4x8) 
Hard DriveHard DriveHard DriveHard Drive
Plextor PX-256M5S 256GB Samsung EVO 1TB Hitachi HDS721010CLA332 Hitachi HDS723020BLA642 
Hard DriveHard DriveHard DriveOptical Drive
Hitachi HDS723020BLA642 Hitachi HUA722010CLA330 WDC WD10EARS-00Z5B1 TSSTcorp CDDVDW SH-S223B 
CoolingCoolingOSMonitor
Phanteks PH-TC14PE with TY-140's Lamptron FCv5 (x2) Windows 8 Pro 64-bit Dell U2412M 
MonitorMonitorMonitorKeyboard
Dell U2412M Dell U2212HM Dell U2713HM Topre Realforce 87UB | Ducky DK9087 G2 Pro 
PowerCaseMouseMouse Pad
Corsair AX-750 Corsair Obsidian 650D Logitech G700 XTRAC Ripper XXL 
AudioAudioAudioAudio
Beyerdynamic DT-770 Pro 250ohm Schiit Bifrost DAC Schiit Asgard 2 HiVi Swan M50W 2.1 
CPUMotherboardRAMHard Drive
Intel Xeon E5-2620 Super Micro X9SRL-F-B 128GB 1333MHz LSI 9271-8i 
OSPowerCase
VMware ESXi 5.5 SeaSonic SS-400FL2 Fractal Define R3 
CPUMotherboardGraphicsRAM
Intel Core i5-3437U HP EliteBook Folio 9470m  Intel HD Graphics 4000  16GB DDR3 SDRAM 
Hard DriveOS
256GB SSD Windows 10 Insider Preview 
  hide details  
Reply
post #3 of 6
Thread Starter 
Thank you, this worked for me indeed!
Rocket Science
(14 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600K 4.8GHz Asus Sabertooth P67 2x 6950 2GB CrossFire G.Skill 8GB 
Hard DriveOSPowerCase
Intel 510 250GB+Samsung 1TB Windows 7 64bit Corsair HX850W NZXT Phantom 
Audio
Sony RF865RK 
  hide details  
Reply
Rocket Science
(14 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600K 4.8GHz Asus Sabertooth P67 2x 6950 2GB CrossFire G.Skill 8GB 
Hard DriveOSPowerCase
Intel 510 250GB+Samsung 1TB Windows 7 64bit Corsair HX850W NZXT Phantom 
Audio
Sony RF865RK 
  hide details  
Reply
post #4 of 6
Just for future reference, batch files are literally just a text file with a list of cmd.exe commands. So if you know how to do something via the command line, you know how to write the batch file as well.
post #5 of 6
Thread Starter 
Quote:
Originally Posted by Plan9 View Post

Just for future reference, batch files are literally just a text file with a list of cmd.exe commands. So if you know how to do something via the command line, you know how to write the batch file as well.

Yes indeed, need to study scripting tbh..
Rocket Science
(14 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600K 4.8GHz Asus Sabertooth P67 2x 6950 2GB CrossFire G.Skill 8GB 
Hard DriveOSPowerCase
Intel 510 250GB+Samsung 1TB Windows 7 64bit Corsair HX850W NZXT Phantom 
Audio
Sony RF865RK 
  hide details  
Reply
Rocket Science
(14 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600K 4.8GHz Asus Sabertooth P67 2x 6950 2GB CrossFire G.Skill 8GB 
Hard DriveOSPowerCase
Intel 510 250GB+Samsung 1TB Windows 7 64bit Corsair HX850W NZXT Phantom 
Audio
Sony RF865RK 
  hide details  
Reply
post #6 of 6
Quote:
Originally Posted by Cmdr.Shephard View Post

Yes indeed, need to study scripting tbh..

If you do decide to study scripting, I'd probably recommend PowerShell or maybe Python over Batch files. It will be tougher to learn, but the rewards will be greater.

Being able to program / script is a great tool to have in your arsenal though, so I fully recommend you learning smile.gif
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming