Find lines in files

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
igurin
Posts: 14
Joined: 10 Dec 2019 20:11

Find lines in files

Post by igurin » 22 Apr 2020 23:22

Background: I want to figure out what Python packages all of my IPython notebooks import.

What I know: How to find all files containing the word 'import'. I know that all of my notebooks contain this word, thank you very much.

What I want: A list of the actual import lines. (I have 96 notebooks, and I don't want to manually open each one to collect this information.)

After writing this post, I figured out that I can do this in Notepad++, but there I don't have Exclude or the other extra-cool options that XY has. It's probably good enough for now, but I'm still curious.

highend
Posts: 9358
Joined: 06 Feb 2011 00:33

Re: Find lines in files

Post by highend » 22 Apr 2020 23:39

Not possible without scripting. The gui search will only list items, not gather specific content into <something> that you could output.
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

igurin
Posts: 14
Joined: 10 Dec 2019 20:11

Re: Find lines in files

Post by igurin » 27 Apr 2020 19:14

Yeah, I guessed as much.

On the other hand, I guess I could use XY search to find the files I want, copy them to a temporary folder, and then use N++ search. Or, if I wanted to be super-fancy, grab a list of the paths and run it into Python.

highend
Posts: 9358
Joined: 06 Feb 2011 00:33

Re: Find lines in files

Post by highend » 27 Apr 2020 19:16

Or you just do it from XY itself
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

Post Reply