How to implement file search by pattern? - linux

I need to get the file name and assign this name to the variable. The file has the following format: webapp-1.1.2.jar. Versions are constantly changing. How to get file name using pattern in linux console?

This is a regex which will match any pattern where the version numbers vary for the jar file.
webapp-[0-9]+\.[0-9]+\.[0-9]+\.jar

Related

I need my Control-M File Watcher job to pick up a file having a specific type of file pattern name

I have files of two file pattern
HUB.SG.20220902.01.P
and
HUB.SG.20220902.001.P
in the second file name the .001. will keep on incrementing like the next file will be
HUB.SG.20220902.002.P
.
.
.
HUB.SG.20220902.100.P
and so on
but the first file will always be of the file name pattern as : HUB.SG.20220902.01.P
I want my File watcher job to just pick file of the pattern: HUB.SG.20220902.001.P and not of the pattern: HUB.SG.20220902.01.P
If I add in my job the filename = "path/HUB.SG..**.P" - it picks up files of both the filename pattern.
How do I resolve this so my file watcher job just picks up file of the filename pattern : "HUB.SG.20220902.___.P"
Use one * to match on one or more characters (including nothing).
Use ? to match single character. In your example you would use HUB.SG.20220902.???.P
However, you can use Control-M system variables for the date (should you be looking for today's dated file as standard). In that case, use %%$ODATE in place of 2022090 etc.
You can use a pattern like:
path/HUB.SG..**.???.P

Windows 7 advanced file searching criteria syntax

I need some help with the windows file search syntax for the criteria that the file name ends with 'xml' and the contents of the file contain the string 'bean'. So far I have it as:
System.FileName:~>"xml" AND
what do I need to put after the AND?
Figured it out:
filename:~> xml AND content: bean

How to get non standard tags in rpm query

I wanted to add things such as Size, BuildHost, BuildDate etc in rpm query but adding this thing in spec file results in unknown tag?? How can I do this so that these things are reflected when i give the rpm query command?
These tags are determined when the package is built; they cannot be forced to specific values.
For example BuildHost is hardcoded in rpmbuild and cannot be changed. There is RFE https://bugzilla.redhat.com/show_bug.cgi?id=1309367 to allow it modify from command line. But right now you cannot change it by any tag in spec file nor by passing some option on command line to rpmbuild.
I assume it will be very similar to other values you specified.
RPM5 permits arbitrary unique tag names to be added to header metadata.
The tag names are configured in a colon separated list in a macro. Then the new tags can be used in spec files and can be extracted using --queryformat.
All arbitrary tags are string (or string array) valued.

how to set default file name extension in CMFCEditBrowseCtrl::EnableFileBrowseButton?

how to give default file name extension in CMFCEditBrowseCtrl::EnableFileBrowseButton? How the arguments should be passed? I tried like following code.
CMFCEditBrowseCtrl py_file_path;
py_file_path.EnableFileBrowseButton(_T"PY",_T"*.py");
But it is not displaying the .py files. It says "no items matches". I guess there is some problem with the lpszDefExt and lpszFilter values i use. Could anyone tell me what is the value of those arguments to list all .py files?
You need to set it like this:
CMFCEditBrowseCtrl py_file_path;
py_file_path.EnableFileBrowseButton(_T("PY"), _T("Python files|*.py||"));
The final argument is a filter string, where the description and filter are delimited by |.

How to specify the name of the generate file to the e:worksheet function

We use the jboss seam-->excel module integration for generating excel sheets using e:worksheet. But the downloaded file name comes out as ExportUsers.jxl.xls, I would rather see this as ExportUsers.xls. How do I customize this information.
filename attribute of the e:workbook tag
<e:workbook filename="ExportUsers.xls" />
Take a look at the Seam excel documentation.
filename — The filename to use for the download. The value is a string. Please note that if you map the DocumentServlet to some pattern, this file extension must also match.

Resources