batch

batch script to add remove prefix zero pad bulk file rename

This post has two batch scripts: 1. Batch script to rename files with zero padded number series-prefix 2. Batch script to remove prefix of perticular length 1. Batch script to rename files with zero padded number series-prefix This script will accept file-type to be searched and lenght of zero-padded prefix to be attached. Usage: RenZeroPad.bat Consider you have to rename / arrange a lot of mp3 files in a perticular sequence: File names before execution: fileX.mp3 fileY.mp3 fileZ.mp3 Command on dos prompt: RenZeroPad.bat mp3 4 File names with attached prefix: 0001 fileX.mp3 0002 fileY.mp3 0003 fileZ.mp3 [ad#ad-2-300×250] The Batch Script...

Using VLookup like Batch script to compare two excel / csv

Using Vlookup: I have two csv files; File1 has Id and Value Columns and File2 has Id. Problem: I need to compare both files and put respective values to File2 from File1. Solution: VLookup in excel Steps: Open both files in Excel & arrange it vertically (Window >> Arrange; for ease) Click on cell where you want to put compared value: B2 Click on fx button and select VLOOKUP function. Under lookup_value, click first search field: A2. Click back in Table_array text field, and click on button to select range. Select two column for comparison starting from second row, i.e....

bat – batch file to create formatted date time (ddmmyyyy) directory

I required to make a batch script which needs file / directory to be created with current date / time stamps. Following are the code snipts for formating date / time in a batch script: FOR /F “TOKENS=1* DELIMS= ” %%A IN (‘DATE/T’) DO SET MYDATE=%%B FOR /F “TOKENS=1,2 eol=/ DELIMS=/ ” %%A IN (‘DATE/T’) DO SET mm=%%B FOR /F “TOKENS=1,2 DELIMS=/ eol=/” %%A IN (‘echo %MYDATE%’) DO SET dd=%%B FOR /F “TOKENS=2,3 DELIMS=/” %%A IN (‘echo %MYDATE%’) DO SET yyyy=%%B set DATED=%mm%%dd%%yyyy% md %DATED: =% or FOR /F “tokens=*” %%A IN (‘DATE/T’) DO SET MYDATE=%%A #Using regular expresions to...