Questions tagged [glob]

globs, more properly called [shell] patterns, and also known as wildcard expressions, are instances of a pattern-matching language used in many, esp. POSIX-like shells, to match filenames and strings: e.g., *.c is a glob for C source files and matches any file whose suffix (extension) is .c

Filter by
Sorted by
Tagged with
0 votes
0 answers
9 views

Ascend Blob *.xls but exclude subdirectories

I have 2 read connectors in Ascend where I'm passing an S3 bucket with a prefix such as: example/more_example/*.xls example/more_example/sds/*.xls The issue is that the first one also collects the ...
Valeri Vladimirov's user avatar
0 votes
0 answers
22 views

Bitbucket pipeline changesets glob pattern for master branch is always skipping

We have a Bitbucket pipeline with a schedule for our master branch, but we only want to deploy if we actually have changes on the master branch. We have tried the changesets as shown underneath, where ...
Judith Van Dongen's user avatar
2 votes
2 answers
67 views

Glob pattern to include files with extension except for in a specific directory

Given the following directory structure: . ├── Examples/ │ └── A.hs ├── Mooc/ │ └── B.hs ├── .stack-work/ │ └── C.hs └── D.hs What is a Bash Glob pattern to include all .hs files except for ...
Abhijit Sarkar's user avatar
-3 votes
1 answer
40 views

The Glob (npm package) does not matches the file which name begins from dot

The Glob pattern: D:/WebDevelopmentProjects/InitiativeClientsProject/Example/HomePage/01-Source/Automation/ToCopy/Production/**/* does not matching the file .env.production.generated with full path ...
Takeshi Tokugawa YD's user avatar
0 votes
1 answer
39 views

Match globs in browser-based JavaScript

In browser-based JavaScript, is it possible to perform glob pattern matching? For illustrative purposes only, I mean a glob like this: **/*.{eot,otf,ttf,woff,woff2}, which could be matched against a ...
lonix's user avatar
  • 15.3k
-1 votes
0 answers
25 views

How do you prevent MATLAB glob from adding a trailing file separator to directory names?

MATLAB glob adds a trailing "\" to directory names. How do you suppress this? I tried glob('directory\') because that's what the help suggested, at least to me. But I still get the trailing '...
John Warren's user avatar
0 votes
1 answer
38 views

Add condition to for loop dataframe dictionary import

I currently have a dictionary consisting of 11 imported dataframes of various sizes. I want to add a condition so that i only import the dataframes that hold a certain number of observations, say 50k. ...
Navi Mateo's user avatar
0 votes
1 answer
40 views

In the Symfony Dependency Injection Service, can I exclude all files in not ending in a specific suffix?

We have been using the Symfony Dependency Injection Service for a while now, but we have to manually link each service to its interface. I want to automate this via auto-wiring, but I have some ...
Lennert's user avatar
  • 27
2 votes
1 answer
37 views

Using glob to recursively get terminal subdirectories

I have a series of subdirectories with files in them: /cars/ford/escape/sedan/ /cars/ford/escape/coupe/ /cars/ford/edge/sedan/ /cars/ferrari/testarossa/ /cars/kia/soul/coupe/ etcetera. I'd like to ...
Clay's user avatar
  • 45
2 votes
0 answers
66 views

Tag filter in GitHub Actions containing underscore

I am trying to get our GitHub Actions workflow to match tags that look like this: package_name-v1.2.3-dev I have split up the tag filter into two sections, since the last part is optional, so it ...
spydon's user avatar
  • 9,969
0 votes
1 answer
13 views

Glob matching file paths with multiple periods

I am trying to match files which have a number of periods in the filename, including the extension, using globs. ls /path/to/my/example.file.txt ls /path/to/my/file.txt ls /path/to/my-example.file.txt ...
myol's user avatar
  • 9,060
1 vote
1 answer
11 views

Glob known subpaths

I am not sure of the name of this feature, but I want to use a glob to limit a path to two known branches. ls /my/path/to/here/ ls /my/path/to/orhere/ I vaguely remember the syntax being something ...
myol's user avatar
  • 9,060
0 votes
1 answer
27 views

Cannot use asterisk as glob pattern normally in Snakemake

I want to use asterisk as glob pattern to stand for "any string of characters except /" (as stated in glob Wikipedia) in Snakemake rule file in its shell section. But noticed that I cannot ...
Xiaokang's user avatar
  • 331
0 votes
0 answers
12 views

Nodemon - ignore everything except repeated specific sub directories

How to make nodemon ignore everything in a folder, except nested sub directories? I want to ignore everything in src folder except every folder with name components (nested etc.) so src/file.js, src/...
user3075373's user avatar
0 votes
0 answers
16 views

Execute a task on subfolders within a folder

I have a folder_X that has multiple subfolders within it. I need to execute my code on all of the files within the subfolder, while keeping them in their respective folders. I have tried glob and os....
NeedsSpatialAttention's user avatar
0 votes
1 answer
94 views

How to recursively match Typescript test files with NodeJS native testrunner

NodeJS recently added a native test runner I can successfully get it to run typescript tests with ts-node or tsx node --loader ts-node/esm --test **/*.test.ts node --loader tsx --test **/*.test.ts ...
Zach Lysobey's user avatar
0 votes
2 answers
44 views

RegEx in Shell script concatenates RegEx filter into filename

I want to detect if a file with a certain datestamp in the name is in a directory. However there is also a timestamp concatenated to it. I can calculate the datestamp but not the timestamp so i need ...
Lars H's user avatar
  • 13
1 vote
2 answers
43 views

glob returns an empty list but in debug mode the list returns as intended

So, i have the "price.pdf" on my pc. The directory is "D:\python\price.pdf" if i am to be precise. And here is the code: import glob pdf_files = glob.glob("*pdf") print(...
Cuteo-P's user avatar
  • 19
0 votes
1 answer
56 views

rsync or any other way to copy files to a new directory using Python

query = 'rsync -zavP [email protected]:/home/server/Catalog/ /home/user/sample' os.popen(query) os.chdir('/home/user/sample') files = glob.glob(*.*) Rsync works great. The files are copied, and a ...
glukoff's user avatar
  • 103
1 vote
0 answers
58 views

Tailwind classes are not working locally; without CDN when loaded offline. Developed in PHP

I have followed step-by-step guide on https://tailwindcss.com but when I try to run my project offline or simply try to comment <script src="https://cdn.tailwindcss.com"></script>...
Banick's user avatar
  • 45
0 votes
1 answer
37 views

Get only children folders i.e. exclude current folder using glob.glob * pattern search

This is how my directory structure looks like: <ROOT>/ ├── root.log ├── a/ │ ├── xyz/ │ ├── a_xyz.log ├── b/ │ ├── xyz/ │ └── b_xyz.log ├── c/ │ ├── xyz/ │ └── d/ │ ├── xyz/ │ ...
Tony Montana's user avatar
0 votes
1 answer
39 views

macOS bash globbing quoted variable unexpectedly [duplicate]

On Linux with bash 5.2.15, single quotes prevent globbing as expected: Good $ dir='/path?/to?/file?'; echo $dir /path?/to?/file? $ However, on macOS with bash 3.2.57, I get this undesirable behavior: ...
Bill Wohler's user avatar
0 votes
3 answers
85 views

Get only folder names using glob.glob * pattern

I am using below line of code to recursively find the folders which has a particular sub-file name endswith .log. glob.iglob(f"{ROOT}/**/*.log", recursive = True) Now, this code gives me an ...
Tony Montana's user avatar
0 votes
3 answers
57 views

Correct pattern to select files using glob

I have a collection of files with name austin1.tif, austin2.tif ... austin36.tif. For 8 different cities. I am trying to separate austin1.tif ... austin5.tif from austin6.tif ... austin36.tif. I came ...
Dae Hyun's user avatar
0 votes
1 answer
61 views

Why are strange symbols equal to numbers in bash?

symbol1=႔ if [[ $symbol1 == [4-5] ]]; then echo "yes" fi output: yes Not the only such symbol that matches a digit in bash.
CuriousPanda's user avatar
0 votes
0 answers
21 views

How does 'dir' output files?

I would like to find out more on how 'dir' in command prompt works. I have a folder with a 365 files, one for each day of the year, and 'dir' spits out the files in order, except for 2023-01-12, which ...
Jonathan Yun's user avatar
0 votes
1 answer
50 views

Python + glob: get a list of specific files from the root of the project directory, while the script location is in one of the subdirectory

please note im a beginner in python, apologies if this is redundant. So, in my current repo, I have the following folder structure: repo-name ->folder1 ->subfolder1 ->script.py ...
ApJo's user avatar
  • 157
0 votes
2 answers
54 views

Why does glob('*[jp][pn]g') work but glob('*p[ng][df]') does not? (Syntax of glob with [])

from glob import glob somefiles = glob(f'{samples_dir}/*p[ng][df]') Returns an empty list. But this one returns all my png and jpg files. The folder contains png, jpg, and pdf files. otherfiles = ...
Jess's user avatar
  • 188
0 votes
1 answer
25 views

Random image using glob

I am trying to get a random image from a dir and every time it returns an error "Warning: Undefined array key 0 $randomImage = call_user_func(function(){ return function() { $i = glob(...
Davidicusrex's user avatar
1 vote
1 answer
32 views

How does the recursive rule work in gitignore

In linux, *.c will only match the .c file in the current directory. If you want to match those in subdirectories as well, you need **/*.c. But in gitignore, *.c will ignore all c file in any level of ...
qiu's user avatar
  • 31
0 votes
0 answers
48 views

Bash regex wildcard file pattern matching

I have a variable called PARAM_COMPARE which is set to *.md. I'd like to compare filenames from GitHub Commits endpoint against PARAM_COMPARE. gh api repos/"$PARAM_GH_PROJECT"/"$...
doughlass's user avatar
1 vote
4 answers
112 views

Organising Folder with same file names and creating a subfolder for them

I have a folder full of tiktok videos I have downloaded. The filenames look like this "2022-12-25_@sample123_7181201932356120774" I want to create a folder for each creator that has more ...
Tab's user avatar
  • 49
0 votes
1 answer
34 views

Match all files exclude multiple directories with glob pattern

I'm trying to write a glob to match all files exclude two directories: app/home and node_modules/package1 /test/app/home /test/app/list /test/app/Test1 /test/app/Test2 /test/app/Test3 /test/...
kevin's user avatar
  • 21
0 votes
0 answers
57 views

Find pathnames using RegEx patterns instead of globs

Is there a currently available way in Python to search for pathnames using regular expressions when globbing is insufficient? For example, # Match abc_123/ and abc/ but not abcd_123/ or abcd/ re_glob(...
LexTron's user avatar
  • 35
2 votes
2 answers
80 views

Bash extended glob pattern negation is not working in parameter substitution

Bash 3.2.57 (on macOS 12.6.8) extended glob pattern negation is not working in parameter substitution: $ shopt -s extglob $ s=abc $ echo ${s##!(a)*} I expected the last command to output abc, but it ...
XDR's user avatar
  • 4,168
0 votes
0 answers
43 views

pathlib glob with absolute paths

I want to glob with absolute path similar to the posed problem/solution in https://stackoverflow.com/questions/56311703/globbing-absolute-paths-with-pathlib. The only difference is that the provided ...
Thomas Hilger's user avatar
0 votes
1 answer
57 views

Scope of disabled globbing in a shell script

I wanted to know what the scope of a "set" command would be in a shell script. Is it limited to the script itself? Or if run via an interactive shell, limited to that particular instance? ...
Ish's user avatar
  • 13
0 votes
0 answers
20 views

TailwindCSS utitlity classes not seen in Nextjs project [duplicate]

For some reason, when my mate tries to initialize a new Nextjs project on his PC, without adding anything extra. He just follows the prompts the Nextjs CLI gives him adding TailwindCSS and the other ...
DEE's user avatar
  • 1
0 votes
3 answers
213 views

Is it possible to glob for *.yaml and *.yml files in one pattern?

How to find all .yml and .yaml files using a single glob pattern? Desired output: >>> import os, glob >>> os.listdir('.') ['f1.yaml', 'f2.yml', 'f0.txt'] >>> glob.glob(pat) [...
no step on snek's user avatar
0 votes
0 answers
8 views

Track all of one dir but only specific files in another [duplicate]

I have a fresh git init --shared which results in: .git /dir1 /dir2 .gitignore I want to track everything inside of dir1 and only .conf files inside of dir2. So far I have this in my gitignore but ...
MonkeyZeus's user avatar
  • 20.5k
0 votes
0 answers
33 views

How to select an image from a database in SQLite 3 in python and display it in an image box

In the following function, an image should be selected from a table of images in a database. The problem is when the interpreter in PyCharm executes this code, the execution is crashed and stops with ...
SaraCoder's user avatar
0 votes
1 answer
22 views

Crash when reading bit map image in python

Using the following code block, I am trying to read and store a bmp image in order to make some image processing using a matching algorithm. print("starting read image function") ...
SaraCoder's user avatar
2 votes
5 answers
99 views

Select by range of letters

Table students I am trying to sort by names for letters in range A-M: I've tried: SELECT * FROM student WHERE student_first_name like '[A-M]%'; It's not giving me anything.
Foze's user avatar
  • 23
0 votes
1 answer
64 views

OS Walk Improper File

This code worked perfectly fine on my mac but when I tried it on windows it's giving me a improper filename which is messing up the entire code. exclude = set(['Images', 'Notes','Programs']) for root,...
Henry_Riflez's user avatar
1 vote
1 answer
30 views

How to check if one wildcard expression (AKA glob) contains another wildcard expression?

I have two wildcard expressions g1 and g2, and I would like to know whether g1 contains g2. For example: g1 = "*.txt" g2 = "hello*.txt" In this case g1 contains g2.
michael's user avatar
  • 550
0 votes
1 answer
24 views

How to get extract directory name from the full filepath name of a file using glob recursive

I have two folders cats and dogs with 5 jpeg images in each cat1.jpeg cat2.jpeg..... dog1.jpeg dog2.jpeg etc... I want to write a CSV file that looks like this 1,./images/trainnew/dogs/dogs2.jpg,dogs ...
Chandrakala Gowda's user avatar
1 vote
2 answers
48 views

bash script that scp with regex

I need some help. I am writing a bash script on RHEL that will use scp to download files from a remote server to the local machine. the way the script works is that you pass it the remote server the ...
goced's user avatar
  • 61
0 votes
1 answer
48 views

How to save multiple multiple csv files at once with changing title?

I'm currently opening opening data from over a 1,000 csv files, each file has a date attached to it. I have modified the data with some code and would like to save the same amount of files with the ...
Bob_007's user avatar
1 vote
1 answer
105 views

How to check whether a string is a valid zsh glob pattern?

I'm writing a zsh program that takes glob patterns as command-line arguments: tss files --tags 'a*' # lists files bearing a tag that starts with an 'a' In order to validate input, is there a way to ...
Nahoj's user avatar
  • 149
1 vote
0 answers
28 views

Different responses for glob in node interpreter and code

I am getting different responses for the following two cases - I am in the directory - dir1 and I am trying to glob for dir2 In interpreter: const { glob } = require("glob") let arr = await ...
Mahima's user avatar
  • 188

1
2 3 4 5
65