Is there any hope of parsing csv-like file with augeas? -
i trying build lens parse file format
#header1 header2 header3 vala1 vala2 vala3 valb1 valb2 valb3
i'd result resemble following tree:
root +--[1] | +----header1 -> vala1 | +----header2 -> vala2 | +----header3 -> vala3 +--[2] +----header1 -> valb1 +----header2 -> valb2 +----header3 -> valb3
the problem first need parse header line learn field names and remember them, , use them multiple times source of key names on following rows. have idea how start writing such lens? i've checked 181 lenses come bundled augeas , found no lens suspect parse tables.
no, it's not possible in augeas store values in header , reuse them labels every line.
you can build tree one:
{ "#comment" = "header1 header2 header3" } { "1" { "1" = "vala1" } { "2" = "vala2" } { "3" = "vala3" } { "2" { "1" = "vala1" } { "2" = "valb2" } { "3" = "valb3" } }
Comments
Post a Comment