The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 01-23-2007
rahulrathod rahulrathod is offline
Registered User
  
 

Join Date: Sep 2004
Location: Mumbai-India
Posts: 158
Question Generate csv file

I have a file which has some thousand records in the following format

File: input.txt ->


<option value="14333">VISWANADH VELAMURI</option>

<option value="17020">VISWANADHA RAMA KRISHNA</option>


I want to generate a csv file from the above file as follows

File: output.txt ->

14333,VISWANADH VELAMURI
17020,VISWANADHA RAMA KRISHNA


The HTML option tags are to be removed alongwith the unwanted tabs and the empty lines in between. I have tried cut, awk, but I am not getting the correct combination. Can you please help me out, as I want to upload this data into a database table.

Thanks.