list - Search file by placement of element in a line -


i trying figure out how pull element file. has 4 elements before have anywhere between none , infinity elements behind it. element pull file named in same spot per line. lines of file formatted so...

$(eval $(call createtest, file, keyelement_0 ... $(eval $(call createtest, file, keyelement_1 ... $(eval $(call createtest, file, keyelement_2 ... ... $(eval $(call createtest, file, keyelement_n ... 

i want able pull keyelement , read list doing this...

proc filtertests path {     set f [listfromfile $path0/listfile]     set f [lsearch -all -inline $f "keyelement_*"]     return $f } 

this works right elements might not follow keyelement_* format need able account this.

edit

the code using read file like;

proc listfromfile {$path1} {     set find {$(eval $(call createtest, file, *}     upvar path1 path1     set f [open $path1 r]     while {[gets $f line] != -1} {         if {[string match ${find} $line]} {     set write [open listfile a]     foreach writetofile $line {     puts $write $writetofile } close $write 

maybe can try

lsearch -regexp -all -inline $f {^.{32}keyelement_\s+} 

or such. of course have modify actual regular expression needed.

will expand if useful.


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -