I have many texts in a folder and the texts contain the following format
#version = 11111
#version = 11112
#version = 11113
#version = 11114
version = 11115
#version is the previous version and version is the newest
I want to find out the line of the newest version(11115) and its lastest version(11114) and list them in another text.
And I have used foreach and glob to find out all the texts but I don't know how to set (version = 11115)line n and the (#version = 11114) line n-1 (or other ways to find out this two lines)
I dont know how to express previous version.
foreach fileName [glob /aaatools/N*/release/version] {
set fp [open $fileName "r"]
while { [gets $fp data]>=0 } {
{[regexp {set [^version =/]+[A-Za-z0-9_]*} $Version] | [regexp {set ??? } $previous_version] } {
set information [$fileName] [$Version] [$previous_version]
set fp2 [open "tool_version" w+]
puts $fp2 $information