| ||Thread Tools||Search this Thread|
code for using a batch file to parse html (.htm) files and export values in .csv format
Can anyone suggest code for using a batch file to parse html (.htm) files and export values in .csv format.
The values required always appear in the format:
and a few lines down
Call No: xxxxx
There are multiple .htm files within the folder and I am trying to write a script to output the relevant values in .csv format from all of the files contained.
Any help would be greatly appreciated, I've been doing it manually getting through a few thousand a day but if I can crack this using a batch file its going to save me loads.
Re: code for using a batch file to parse html (.htm) files and export values in .csv format
It is always recommended to avoid nested if as they become soon unreadable. So the following code performs what you want in cleaner and more friendly way.
For /f "tokens=2,3 delims= " %%a in (sample.txt) Do (
If "%%a"=="ADMINS_CAS_SENS" Echo %%a %%b
If "%%a"=="OLD_PASSWORD" Echo %%a %%b
|Tags: batch file, csv, parse|
|Thread Tools||Search this Thread|
|Similar Threads for: "code for using a batch file to parse html (.htm) files and export values in .csv format"|
|Thread||Thread Starter||Forum||Replies||Last Post|
|run Batch-file export in excel (its for a Movie database)||rayg||Software Development||4||22-12-2010 07:31 PM|
|Could not complete your request because the file-format module cannot parse the file||Tamila||Windows Software||6||13-07-2010 12:29 AM|
|Batch Script Text file firstname.lastname@example.org||Windows Server Help||5||25-03-2009 02:12 AM|
|Batch file to list directories, export to CSV||chickenfriedsteak||Windows Server Help||1||16-02-2009 07:35 PM|
|Batch Script to parse lines in text email@example.com||Windows Server Help||8||28-01-2009 03:38 AM|