Brutal 164 Posted November 17, 2013 Report Share Posted November 17, 2013 Hi guys, I am hitting brain-block and hope you can help. I am searching/looping through a csv file looking for a list of keywords. Once it finds a word in the csv file that is contained in my list, I want it to save that entire row into a new table. I have figured out how to get it to save a list of the row numbers that i want to extract row data for, but still haven't figured out how to save the actual row data into a new list. [if] table row [contains] -keyword[then] add row to listSeems so simple - yet it's kicking my butt. Quote Link to post Share on other sites
bestmacros 60 Posted November 17, 2013 Report Share Posted November 17, 2013 try this clear table(&www) clear list(%qqq) set(#pos, 0, "Global") loop($table total rows(&www)) { set(#loop columns, 0, "Global") loop($table total columns(&www)) { if($comparison($table cell(&www, #pos, #loop columns), "=", "keyword")) { then { add list to list(%qqq, $plugin function("TableCommands.dll", "$list from table", &www, "Row", #pos), "Delete", "Global") } } increment(#loop columns) } increment(#pos) } Quote Link to post Share on other sites
Brutal 164 Posted November 17, 2013 Author Report Share Posted November 17, 2013 Thanks BestMacros - That got me a lot closer to the goal than I was before. Now the problem is that I need it to accept partial match on the keyword. For example - if keyword is 45 BASIC ...but cell content is #45 BASIC ENERGY SVC/MID I would still want it to identify this and save that row. I'm trying to figure it out using regex - but no luck so far. 1 Quote Link to post Share on other sites
Brutal 164 Posted November 17, 2013 Author Report Share Posted November 17, 2013 Is there any way to accept a partial keyword match while working with $comparison ? Quote Link to post Share on other sites
bestmacros 60 Posted November 17, 2013 Report Share Posted November 17, 2013 yes, use "contains" instead "comparison" Quote Link to post Share on other sites
Brutal 164 Posted November 17, 2013 Author Report Share Posted November 17, 2013 BestMacros - You're a Rock Star!.... I'm good to go now... Many thanks. 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.