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`.

0
votes
1answer
17 views

Passing a string variable to glob

I'm trying to pass a directory to glob which will be read to a variable from a config file. If I just do this it works fine: path ='//Server/Company/Official Documents/**/*.pdf' Files = glob.glob(...
0
votes
1answer
25 views

Parsing starting points of concated files

I have 3 csv files in 3 different folders that I need to merge and then do averages on values of each individual line (there is about 4000 lines in each file. I have managed to combine panda ...
0
votes
1answer
24 views

Load multiple csv files from a folder with a condition

I have a very unstructured folder, where a lot of files have no entries (just the row headers), but there is no data inside. I know that i can include them and they will not change anything, but the ...
0
votes
1answer
14 views

Single glob expression to match contents of subdirectory with given name but not contents of (parent) directory with such name

Given the following paths: @c8y/apps @c8y/client project-a/@c8y/client project-b/@c8y/client foo/@c8y/client bar/@c8y/client baz/@c8y/client qux/@c8y/client I expect to match only the entries that ...
0
votes
0answers
21 views

Trying to pattern match partial file name in multiple folders using glob.glob

I am trying to find the newest version of files, each of which contains a unique reference code as part of their file name e.g. 12345. I have a large list of reference codes which are in pairs because ...
0
votes
1answer
22 views

How can I combine files with matching ending characters?

I have excel files named like "name1 01.01.2018.xlsx", "name1 01.01.2018.xlsx", "name2 12.23.2019.xlsx", and so on. I want to join all files with matching dates (last 10 characters). I can join all ...
3
votes
2answers
70 views

Add modification of file time stamp column while using glob

I have multiple files in a folder that get modified by users at different times. Every week I go and consolidate them all in to one master file but I need to keep track when the file was modified last ...
-1
votes
1answer
28 views

glob() got an unexpected keyword argument 'recursive'

I try to run a script that uses the glob() function, but it gives me this error: imagePatches = glob('/kaggle/input/IDC_regular_ps50_idx5/**/*.png', recursive=True) TypeError: glob() got an ...
0
votes
1answer
12 views

Glob module returning wrong value

I have bunch of folders like below example and inside each folders have following number of files. Now when I want to know how many files are inside Pos2 folder then I am getting wrong output. For ...
0
votes
1answer
32 views

Python; read and write all files in a folder

I want to write a code in Python which should read all the files in a folder and then convert them to Wav format. I am using below code, but it get no result: import glob import obspy from obspy ...
0
votes
0answers
9 views

how to retrieve more than one file using for loop?

I have folder which contains files with different extension (e.g .TIF, .IMD,.txt) and I want to retrieve two files with same extention (e.g B2.TIF and B5.TIF) from rasterio import Affine as A ...
0
votes
0answers
28 views

why does glob give different result for every iteration? [duplicate]

Here below is the simplified version of my perl script. The directory has a .txt file and if statement with glob is used to check if there is a txt file. On iterating, during the first iteration if ...
0
votes
0answers
13 views

Is it possible to introduce error handling for multiple imports with webpack glob imports

s it possible to introduce error handling for multiple imports when either the path or the match criteria is wrong. Presently it throws TS2304: Cannot find name error when the import fails for e.g....
0
votes
1answer
35 views

File::Globstar not working for some patterns

I am trying to use the File::Globstar module to search for files recursively. https://metacpan.org/pod/File::Globstar#EXAMPLES. However, some of the patterns given in the documentation are not ...
1
vote
1answer
21 views

Use `**` but ignore directories that match the specified name

I am looking for a glob that matches all descendant directories except those of a specific name. For instance foo/**/*.js matches all *.js files that are descendents of foo/, which is good; the ...
0
votes
1answer
49 views

How can I read multiple csv files from a single directory and graph them separately in Python?

I want to read csv files from a directory and plot them and be able to click the arrow button to step through a plot and look at a different plot. I want to specify which column and be able to title ...
0
votes
0answers
12 views

PHP glob match filename with specfiic format

I'm having some trouble to match a specific file format with glob in PHP. I can't get the right pattern to match my cases. I'm trying to read and match a folder with some files with this name format: ...
2
votes
1answer
40 views

How can I find files and folders whose names start with a dot?

I am trying to write a script to recursively descend into a directory structure to find *.sm and *.ssc files. However, my script skips over folders whose names start with a dot, for example .Folder ...
-1
votes
1answer
19 views

How to rename multiple file names in python

I want to rename multiple files in a folder as they The current filename as follows: 3321_AD_axial_001_MRI.jpg 3421_AD_axial_098_MRI.jpg 3521_AD_axial_032_MRI.jpg The expected filename as follows:...
0
votes
0answers
20 views

node-glob not finding file that exists and is matched by minimatch (Windows 10)

I am trying to write a glob pattern that will search for intellij binaries (roughly), but not search inside C:\Windows since there will not likely be any in there. I've added a bunch of minimatch ...
0
votes
1answer
31 views

processing multiple xml files and saving all the output inside a single .txt file

i implemented through python,to parse a single XML file and process it and and the input and output (is in multiple lines) like this: address = glob.glob('*.xml') #print(address) for single_add in ...
0
votes
0answers
40 views

Selecting files in a CircleCI environment results in “uninitialized constant Diff” error

Locally I am running these things: ruby: 2.5 bundler: 2.0.1 rspec: 3.8 I am trying to use CircleCI to run tests for a number of files but none of the documented ways appears to be working. ...
0
votes
0answers
6 views

How to select ONLY one file out of multiple files using glob-sync?

I have some files structure like this - patterns/components/accordion/index.js patterns/components/accordion/markup.hbs patterns/components/banners/markup.hbs patterns/elements/checkbox/markup.hbs ...
1
vote
1answer
19 views

Does GitHub Linguist's languages.yml allow wildcards in extensions?

Let's say we have a programming language that uses files with various extensions, all of which share some characters that indicate the language, but continues with additional characters that indicates ...
0
votes
1answer
29 views

How to identify files that contain duplicate headers when appending 300+ excel spreadsheets?

I'm trying to append 300+ xlsx files into one, but I get the following error: AttributeError: 'NoneType' object has no attribute 'is_extension' Error Screenshot: After some googling, I found that ...
1
vote
1answer
56 views

How to escape square brackets in file paths with Invoke-WebRequest's -OutFile parameter

When you include something like [1] in a file name like File[1].txt used with the Invoke-WebRequest and the -OutFile parameter you get an error Cannot perform operation because the wildcard path File[...
0
votes
1answer
39 views

Concatenating multiple excels with same column names and sheets

I have 40 files, 3 sheets, Happy, Still, Sad and in each sheet the column titles are the same. I want to concatenate those 40 files so that each sheet will have the information of all 40 files. for ...
1
vote
3answers
42 views

Correct Regex in SFTP bash script

I want to automate a SFTP process to transfer the last file created in local server and send it to remote server. In local server I have "/Source/Path/" I have files named like below: Logfile_2019-...
0
votes
1answer
15 views

Walking a directory, looking for .xls files and glob is ignoring them (Python and glob module)

I wrote a for loop that walks a directory tree and does successfully return all the files names. The sub folders include .pdf files so I'm trying to extract data only from the .xls files. Using glob(...
0
votes
0answers
11 views

How to make Visual Studio Code read files without an extension as.html via “files.association” in settings.json

I have switched from Atom to Visual Studio Code, and have loaded up my project folder. My HTML files are extensionless, rather than have .html at the end. This is because when I upload them to AWS S3, ...
0
votes
2answers
35 views

Match all files that are inside a folder and ignore one folder inside

I have the following directory structure: root ├─ files │ ├─ folder1 │ │ ├─ file1.js │ | └─ file2.js │ ├─ folder2 │ │ └─ file3.js │ ├─ file4.js | └─ file5.js └─ config.js How can I match ...
0
votes
1answer
33 views

Is there a way to create a function to load all data files in directory and then output their file name and content?-Python 3

Is there a way to create a function to load all data files in directory and then output their file name and content? Input: Get all files in a given directory of mine (wow.txt, testting.txt, etc.) ...
2
votes
6answers
55 views

Is there a way to load data from all files in a directory using Python?

My question: Is there a way to load data from all files in a directory using Python Input: Get all files in a given directory of mine (wow.txt, testting.txt,etc.) Process: I want to run all the ...
0
votes
1answer
28 views

Why this concatenation method is not importing headers?

I was using this piece of code to concatenate several excel spredsheets into one(Using python 3 and Pandas): all_data = pd.DataFrame() for f in glob.glob("name*.xlsx"): df = pd.read_excel(f) ...
1
vote
0answers
31 views

Globbing and renaming accented files in Bash (continued)

This is a continuation of the following question: Globbing accented files in Bash I asked it there, but was encouraged to ask a new question. I have about 20,000 thousand files, many of which need ...
0
votes
0answers
19 views

Issues with path.getctime in Python

I'm trying to pull the newest file (only the filename) in a directory, I can successfully do this from the same directory, not from a separate one. Working from the same directory has no issues doing ...
0
votes
3answers
45 views

How to Rename Parts of Filename in Python

I am trying to rename a number of files using Python so that they follow a new naming convention that looks like: ~/directory/yyyy + qq + directory_name + ' Letter'. Right now, they are in this ...
0
votes
0answers
31 views

Python: Glob only reading one file instead of two

I have two different .txt files. I am trying to read and turn them into a dictionary. I noticed that on the function I have, it only reads one of the files. I thought glob would at least read through ...
0
votes
0answers
23 views

How to exclude from the crawler all the tables of the folder EXCEPT some in AWS Glue

I have a S3 bucket with all my row data directly in it (no subfolders). I am building the data catalog with AWS Glue. For now, I have 1000 tables. But I will soon have a lot more. I am looking for a ...
2
votes
2answers
24 views

Finding path names with non-consecutive numbers using glob in Python

Is there a way to find file names with numbers that are not consecutive? More specifically, I'm looking to list filenames with these numbers included: path +'*.s201701*.nc' path +'*.s201801*.nc' path ...
0
votes
0answers
131 views

Meaning of ** (and other symbols) in a Symfony Glob Pattern

A few years back Symfony introduced glob patterns for importing and loading configuration files. You can see an example of this in the stock kernel class protected function configureRoutes(...
0
votes
1answer
35 views

Read images of multiple datatypes from multiple subdirectories

I want to read images of multiple datatypes from multiple subdirectories in python using glob function I have successfully read images of JPG type from the subdirectories. Want to know how can I read ...
0
votes
1answer
54 views

Combine csv files with same name from different subfolders in to one csv

I have three CSV files each for a particular filename for multiple files. Let's say there are a total 20 filenames so total 20* 3csv files in three different folders. Folder A- 1001.CSV,1002.CSV,...
0
votes
0answers
16 views

Combine columns from multiple csv files to a single csv file from subfolders of a folder

This is for creating the final dataframe for my analysis.So I have three kinds of csv files.I want to extract specific columns from file 1 & file 2 and concatenate it to file 3 to get a single csv ...
13
votes
3answers
340 views

Pattern match does not work in bash script

Using the pattern match !("file1") does not work within a bash script but will work on the command line. For example: ls !("file1"|"file2") This will list all files in directory except file1 and ...
1
vote
1answer
121 views

Flask send_file is sending old file instead of newest

I have a flask app where using one Flask route the server creates a csv file and saves it to the server. Using a generated button on the client page, another Flask route is triggered to get the most ...
1
vote
1answer
50 views

Combine selected column from multiple csv files from different folders to a single csv file

This is for creating the final dataframe for my analysis.So I have three kinds of csv files.I want to extract specific columns from file 1 & file 2 and concatenate it to file 3 to get a single csv ...
0
votes
2answers
17 views

How do I iterate through folders before the wanted document?

I am trying to code a script that will collect values from a .xvg files. I have 20 folders that contain the targeted file. Folder are numerated from 1-20 (in the code you see 1.Rimo) I have already ...
0
votes
0answers
23 views

node glob sync returns empty array

I am using glob nodejs module to sync files using patterns I did : glob.sync('C:\Users\maroodb\project\config\*.json') but it returns : [] such the config folders contains 15 files *.json is ...
5
votes
1answer
44 views

Create folders dynamically and write csv files to that folders

I would like to read several input files from a folder, perform some transformations,create folders on the fly and write the csv to corresponding folders. The point here is I have the input path which ...

http://mssss.yulina-kosm.ru