Creating Batch File for Daily Update using CSV

May 13, 2012 at 01:26:11
Specs: WinXP
Hi,

Can someone please help me to create a batch file for my daily use. It is too troublesome to do it everyday without a batch file.

1) Combine all csv files in the folder and name the filename as the first file catsproducts.csv
I will have 3 files
catsproducts.csv
catsproducts10may.csv
catsproducts11may.csv

2) Promote me to key in my keywords and Search Colume 1 of the catsproducts.csv (CSV file) with keywords : wellness chicken "cat food"

3) Del from row 1 of the catsproducts.csv (CSV file) to the keyword.

4) Print out how many rows in the catsproducts.csv (CSV file).


See More: Creating Batch File for Daily Update using CSV

Report •


#1
May 13, 2012 at 08:33:42
May be this script can help you.

@ECHO OFF
CLS
IF EXIST all_csv.txt DEL /Q all_csv.txt
TYPE *.csv >> all_csv.txt
fart.exe all_csv.txt "wellness chicken "cat food"" "<your Keyword>" >NUL
fart.exe all_csv.txt "<Some Key word in row 1 of ur file>" " " >NUL
END

:: fart.exe you can find in below link
::http://digg.com/newsbar/topnews/FART_exe_Find_And_Replace_Text_for_Windows


Report •

#2
May 13, 2012 at 09:38:06
Hi oUMMo,

Thanks for your reply.

However this batch file only conbine all the csv and replace the keyword. And replace of keyword is not what I want to do for the batch file.

The next step is suppose to remove from row 1 to the keyword row.
Meaning, if the keyword is at row 1050, it will remove from row 1 to 1050.

For example.
catsproducts.csv is 2900 rows
catsproducts10may.csv is 3000 rows
catsproducts11may.csv is 2000 rows
and the keyword is at row 1050

After the batch file catsproducts.csv
2900 + 3000 + 2000 = 7900 - 1050 = 6850 rows left.

Thanks once again.


Report •
Related Solutions


Ask Question