glob Questions

4

Solved

I am using pathlib.glob() and pathlib.rglob() to matching files from a directory and its subdirectories, respectively. Target files both are both lower case .txt and upper case .TXT files. Accordin...
Forklift asked 14/3, 2022 at 15:53

3

Solved

I want find all images and trying to use pathlib, but my reg expression don't work. where I went wrong? from pathlib import Path FILE_PATHS=list(Path('./photos/test').rglob('*.(jpe?g|png)')) print(...
Principalities asked 7/1, 2022 at 21:4

4

Solved

Is it possible to include multiple patterns in a single search string in glob for nodejs? Like i need to find all files that have "abc.pdf" and "xyz.pdf".
Crin asked 28/2, 2020 at 15:49

42

Solved

Is there a better way to use glob.glob in python to get a list of multiple file types such as .txt, .mdown, and .markdown? Right now I have something like this: projectFiles1 = glob.glob( os.path....
Caulicle asked 31/12, 2010 at 6:39

3

Solved

I need to list all files in the current directory (.) (including all sub directories), and exclude some files as how .gitignore works (http://git-scm.com/docs/gitignore) With fnmatch (https://docs...
Vaden asked 10/8, 2014 at 14:31

21

Solved

If I want to check for the existence of a single file, I can test for it using test -e filename or [ -e filename ]. Supposing I have a glob and I want to know whether any files exist whose names ma...
Jailbird asked 30/5, 2010 at 3:22

8

Solved

I'm using msysgit (1.7.9), and I'm looking for the right invocation of the git ls-files command to show just the (tracked) files and directories at the current level, either from the index, or the ...
Flintlock asked 4/5, 2012 at 16:50

12

Solved

I want to be able to match a pattern in glob format to a list of strings, rather than to actual files in the filesystem. Is there any way to do this, or convert a glob pattern easily to a regex?
Mensa asked 31/12, 2014 at 21:41

2

Solved

I just found http://gruntjs.com/configuring-tasks#globbing-patterns, which is the most helpful reference I've found. I keep seeing: For more on glob pattern syntax, see the node-glob and minima...
Thorfinn asked 14/6, 2014 at 16:44

3

Solved

How to use glob to only read limited set of files? I have json files named numbers from 50 to 20000 (e.g. 50.json,51.json,52.json...19999.json,20000.json) within the same directory. I want to read...
Thingumajig asked 19/5, 2014 at 10:35

3

Solved

I want to use pathlib.glob() to find directories with a specific name pattern (*data) in the current working dir. I don't want to explicitly check via .isdir() or something else. Input data This is...
Remy asked 9/9, 2022 at 8:35

1

Solved

Trying to use Webpack to bundle and minify all the JS files to a bundle.min.js file, and all the CSS files into a bundle.min.css file. Folder structure: root |- assets |- src |-- js |--- *.js |-- c...
Karrikarrie asked 29/6, 2023 at 18:26

6

Solved

I am running ubuntu 14.04 and trying to launch ROS Simulator. I have this error: ImportError: No module named 'glob' Installing glob2 does not solve the problem. python -m site output: sys.pat...
Collision asked 22/3, 2017 at 23:43

4

Solved

Can I use boto3's filter tool for finding keys (technically sub-keys) in a bucket akin to files in a directory using glob? I want to get a list of keys with a pattern like this "key/**/<pattern...
Philpott asked 16/2, 2016 at 20:29

5

Solved

I'm messing around with file lookups in python on a large hard disk. I've been looking at os.walk and glob. I usually use os.walk as I find it much neater and seems to be quicker (for usual size di...
Hussy asked 19/1, 2012 at 18:10

3

Solved

Consider this pattern: *.py. It matches all the paths ending with the py extension. Now, is it possible to find a pattern which matches everything else? I thought this would do it: *[!.][!p][!y], ...
Adamis asked 15/8, 2014 at 8:13

2

Solved

I have an array of directories to exlude from the result of my find command, something like EXCLUDE=("foo" "bar"). I can run this from the interactive terminal like so: find . -name 'hvr.yml' -no...
Baumbaugh asked 3/7, 2018 at 14:41

7

Solved

I have this line of code in my python script. It searches all the files in in a particular directory for * cycle *.log. for searchedfile in glob.glob("*cycle*.log"): This works perfectly, howev...
Talon asked 2/5, 2014 at 14:21

4

Solved

When there are too many matching files, shells like bash break if you include a glob pattern on the commandline like perl -pi -e 's/hi/bye/' too_many_files* You can work around this with xargs, gn...
Bifurcate asked 12/3, 2023 at 18:43

2

Solved

I'm trying to copy files from one location to another using subprocess library and Popen method. When runing following script I'm getting the error cp: cannot stat /some/dev_path/*. I was told that...
Beecham asked 4/9, 2012 at 16:34

6

Solved

I have python 2.7 and am trying to issue: glob('{faint,bright*}/{science,calib}/chip?/') I obtain no matches, however from the shell echo {faint,bright*}/{science,calib}/chip? gives: faint/scie...
Pinnatipartite asked 10/4, 2014 at 18:55

5

Solved

I have a program that generates text files output1.txt, output2.txt, output3.txt, etc.. I want Git to ignore these files. I can't block text files, as I have some text files that shouldn't be ignor...
Leupold asked 28/11, 2014 at 6:43

5

Solved

I try to loop over all files matching a certain extension, including those inside hidden folders. So far I haven't found a way to do this with iglob. This works for all folder except those starting...
Transpire asked 1/3, 2018 at 10:17

3

This should work but doesn't and gives the following error (below). I've read a couple of posts on stackoverflow here and here but there doesn't seem to be a good answer that works in this case. ...
Klipspringer asked 13/12, 2016 at 21:21

29

Solved

How do I count only the files in a directory? This counts the directory itself as a file: len(glob.glob('*'))
Prestigious asked 13/4, 2010 at 18:38

© 2022 - 2025 — McMap. All rights reserved.