I use strings like !*main*.js to filter out some files. But what if on top of this, I need the files to have 'test' in the file name?
I tried the following but they won't work:
!*main*.js & *test*
!*main*.js && *test*
!*main*.js AND *test*
You can use comma to separate conditions:
!*main*.js,*test*
Alternatively, you can use Scopes: https://www.jetbrains.com/help/go/configuring-scopes-and-file-colors.html
Related
I have an SFTP directory that contains several files in this format
19328D_T001045863113302101909_20220721_103898.txt
1932A8_T001045863113302101909_20220721_103802.txt
The part starting with T i have saved as a dynamic variable vars.transaction (e.g. vars.transaction == "T001045863113302101909"). I want to do a check if I have any files in this directory that contain my vars.transaction in the filename.
So I think I need to use sftp list connector, edit inline and use filename pattern. But as there is numbers before and after the Transaction part I am not sure what to put in the filename pattern. Something like [#vars.transaction]
Thanks in advance
You can use the wildcard * along with your variable. Like *#[vars.transaction]* that will match all the files which has the vars.transaction in their name
We are trying to read file from directory based on pattern from azure blob srorage.We are using
pathGlobFilter option to select files. The directory contains following files
Sales_51820_14529409_T_7a3cc7d1d17261fd17e7e1fabd3.csv
Sales_51820_14529409_7a3cc7d1d17261fd17e7e1fabd3.csv
Sales_61820_17529409_7a3cc7d1d17261fd17e7e1fabd3.csv
Sales_61820_17529409_T_7a3cc7d1d17261fd17e7e1fabd3.csv
We need to process only those files which does not have "T" in file name .We need to process only these two files
Sales_51820_14529409_7a3cc7d1d17261fd17e7e1fabd3.csv
Sales_61820_17529409_7a3cc7d1d17261fd17e7e1fabd3.csv
But we are not able to read only these two files.
Here is the code,
df = spark.read.format("csv").schema(structSchema).options(header=False,inferSchema=True,sep='|',pathGlobFilter= "Sales_\d{5} _ \d{8}_[a-z0-9]+.csv$").load("wasbs://abc#xxxxx.blob.core.windows.net/abc/2022/02/11/"
Regards,
Rajib
Glob is not a standard regular expression, there is differences between them.
For example glob doesn't match the number of times.
For details, see:here
Back to this question, a relatively stupid way, looking forward to the perfect solution of the giant.
pathGlobFilter="Sales_[0-9][0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]_[a-z0-9]*.csv"
I'm trying to remove accents with Pentaho. It's possible use regular expression, but is there another simpler way?
I'm using Pentaho 6.
The simplest way is use a Modified Java Script step using apache commons. This lib is already packaged inside the tool. With the following code you are ready to go:
COLUMN_SANITIZED = org.apache.commons.lang3.StringUtils.stripAccents(COLUMN_SANITIZED);
Don't forget do add this column in the fields section in Modified Java Script with option Replace value 'Fieldname' or 'Rename To' to Yes.
I have one .pro file which has inputs jars mentioned as below:
-injars \plugins\a.b.c_1.0.0.201803060704.jar
trying to provide -injars \plugins\a.b.c_1.?.?..jar or a.b.c_.jar but proguard is not recognizing it. getting an error as (No such file or directory).
The basic question is does proguard support regex in -injars section?
Yes, there's a glob style pattern matching called filtering. No, it doesn't look like it's supported for -injars (I tried using their filter syntax both with and without single quotes).
I wasn't able to use their file filtering in the proguard.cfg file loaded by maven for the -injars flag. So, not sure where all it's supported or exactly how it's implemented for files.
? matches any single character in a file name.
* matches any part of a filename not containing the directory separator.
** matches any part of a filename, possibly containing any number of directory separators.
For example, "java/**.class,javax/**.class"
matches all class files in the java and javax.
http://www.dre.vanderbilt.edu/~schmidt/android/android-4.0/external/proguard/docs/manual/usage.html#filefilters
Is it possible to rename a file after building it in Sublime Text 3? By default, the output is the same as the input; so filename.scss is built to filename.css. But what if I want filename.scss.css by default (to indicate that this file is based off of a scss file). Is this possible?
Yes. Read through the Build Systems Reference for details. First, there are several variables you can use. $file is the reference to the full path of the current file, say /home/foo/test.php. There is also $filepath (/home/foo), $file_name (test.php), $file_extension (php), $file_base_name (test), and some others. You can also use regexes just about anywhere inside curly braces ($file is the same as ${file}). For example, ${file/\.php/\.txt/} will rename its suffix from .php to .txt (/home/foo/test.txt). ${filepath/testing/production} changes the directory. Here are several combined in a contrived example:
"cmd": ["myprocessor", "--infile", "$file", "--outfile", "/mnt/${project_name}/var/www/assets/${file_base_name/test/final}.css"],
...
For your particular case, this should work:
"cmd": ["myprocessor", "--infile", "$file", "--outfile", "$filepath/$file_name.css"],
should take /path/to/yourfile.scss and spit out the processed /path/to/yourfile.scss.css if that's what you want.