How to string the word in file content and convert into CSV from multiple file

This topic contains 1 reply, has 2 voices, and was last updated by  Olaf Soyk 2 weeks, 4 days ago.

  • Author
    Posts
  • #76354

    Robert
    Participant

    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

  • #76400

    Olaf Soyk
    Participant

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

You must be logged in to reply to this topic.