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 03-18-2008
zer0dvide zer0dvide is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 3
converting config file to csv format

Hello,

For 2 days now i've been searching for a solution to this. I am now beginning to doubt this is even possible. It's even harder when you don't know how to search for it. (which keywords generate enough relevancy etc..)

I need to parse a config file to generate a CSV file in return.
It would need to take these parameters out of the file:

define host{

host_name hostA
parents hostNull
}
--
define host{

host_name hostB
parents hostA
}
--
define host{

host_name hostC
parents hostB
}
--

and create this:

host,parent
hostA,hostNull
hostB,hostA
hostC,hostB

Does anyone know a solution to this or can someone point me out to some doc that explains how ?