Author Posts

August 1, 2017 at 1:06 pm

Hello!

I have application file and content looks like below. Each file having 5

or 6 server name in the content, same I have 800+ file under data folder.

A sample of file content:-

HOST "Developserver.com" Developserver.com
{
-trees
"/"
-exclude
"/tmp/pro**"
"/var/opt/Client"
"/dev/__pv**"
"/var/locks/slp.lock"

}

HOST "Testserver.com" Testserver.com
{
-trees
"/"
-exclude
"/tmp/proc**"
"/var/opt/Client"
"/dev/__pv**"
"/var/locks/slp.lock"

}

Now, how to read and string the content after "-exclude" and convert into

csv format like this

A Sample of Result:-

FileName HostName Excludelist
Dummy Developserver.com "/tmp/pro**"

"/var/opt/Client"

"/dev/__pv**"

"/var/locks/slp.lock"

Dummy Testserver.com "/tmp/pro**"

"/var/opt/Client"

"/dev/__pv**"

"/var/locks/slp.lock"
Any help much appreciated. Thx RR

August 2, 2017 at 6:14 am

The following video might help you with your task Sophisitcated Techniques of Plain Text Parsing