Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



code for using a batch file to parse html (.htm) files and export values in .csv format

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 18-03-2011
Member
 
Join Date: Mar 2011
Posts: 1
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:

Applicant No.xxxxx

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.

Cheers Guys,

James

Reply With Quote
  #2  
Old 19-03-2011
Member
 
Join Date: Jan 2006
Posts: 605
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.

@Echo Off
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
)
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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 parse tator.usenet@gmail.com 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 file jntoner1@gmail.com Windows Server Help 8 28-01-2009 03:38 AM


All times are GMT +5.5. The time now is 06:17 AM.