A
Alpha Blue
Hi guys,
I've always had trouble with regexp and matching. I'm trying to figure
out how to parse a very lengthy file that contains information similar
to below:
["Name"] = {
80, -- [1]
"Company", -- [2]
"2009-08-14", -- [3]
},
["NameTwo"] = {
24, -- [1]
"Company Two", -- [2]
"2009-08-14", -- [3]
},
The only information I am interested in is the following:
["Name"]
["NameTwo"]
And to further break it down, I'm only interested out of that:
Name
NameTwo
The large file contains roughly 10,000 - 20,000 lines of the similar
data below.
I just want to do open the file, parse out the information as it finds
it, and place it into an array for writing to another file which
contains the proper syntax.
Any help would be appreciative on how to match the specific line to get
that piece of data, and how to ignore the rest of the lines it finds
that contains no matches.
Many thanks.
I've always had trouble with regexp and matching. I'm trying to figure
out how to parse a very lengthy file that contains information similar
to below:
["Name"] = {
80, -- [1]
"Company", -- [2]
"2009-08-14", -- [3]
},
["NameTwo"] = {
24, -- [1]
"Company Two", -- [2]
"2009-08-14", -- [3]
},
The only information I am interested in is the following:
["Name"]
["NameTwo"]
And to further break it down, I'm only interested out of that:
Name
NameTwo
The large file contains roughly 10,000 - 20,000 lines of the similar
data below.
I just want to do open the file, parse out the information as it finds
it, and place it into an array for writing to another file which
contains the proper syntax.
Any help would be appreciative on how to match the specific line to get
that piece of data, and how to ignore the rest of the lines it finds
that contains no matches.
Many thanks.