Control-M How do I remove a portion of the filename during Advanced File Transfer - control-m

I am trying to figure out how I can simply remove a portion of a filename on a transfer. I need the numbers to remain unchanged with 'check-aft' buttressing up against them as a prefix.
Source: check-aft-eft-12345678-0001
Destination: check-aft12345678-0001
I cannot for the life of me figure out how to either use the Find and Replace feature which BMC mentions, but then provides zero guidance for, or how I would utilize the variables to do so. I have review all of their documentation and watched so many videos, but they do not cover this scenario.
I would appreciate any help getting '-eft-' removed from this filename.
I have tried creating variables for '-eft-' and for 'check-aft' but I am unable to figure out how i can tell it to look for 'check-aft-eft-' and remove '-eft-'

Find & Replace is used for making bulk changes to job definitions, it has no direct relation to AFT jobs (unless you are changing the AFT job defs, that is).
The AFT jobs have many useful features hidden away on the "Advanced" button. If you literally want to change the file name, click Advanced and go to "Destination Actions" on the General tab. Here select "Renamed" where it says "After the completion of a successful file transfer the destination file will be:" and enter check-aft12345678-0001.
If, however, the numbers can be any value - go to the "File Watcher" tab (still in the "Advanced" pop-up) and use "Output / Variable containing detected file name". Set it to something like found_aft_file_1.
You now have a variable that you can do SUBSTR on -
%%PARTONE = %%SUBSTR %%found_aft_file_1 1 10
%%PARTTWO = %%SUBSTR %%found_aft_file_1 15 13
Then %%PARTONE.%%PARTTWO will return the required value.

Related

(Robot Framework IDE) RIDE->Search Tests Window-> Search tab what is "ADD all to Selected" used for

As the title says, in RIDE interface for Robot Framework, on the Search Tests Window, i have two Tabs:
1-Search 2- Add All to Selected
For first Tab, i wonder if i can insert a list of Test cases on search box and if the second TAB
will tick them on the interface.
I couldn't use it in this way but seems to function like that.
Any idea?
Edit:
So here i have added two complete test names separated with comma followed by space:
but as you see the Search Engine finds only the last test name. I can search by what i have added as TestID inside Documentation of each test,and add something like :
TC-69, TC67 but search engine finds as before only the last test.
You don't mention what version of RIDE you are using. In the past there was a bug on that search feature.
Today I have verified that Search function is working as expected on RIDE version 2.0b2, in Windows 10, Python 3.9 and wxPython 4.1.1.
I used a list in the Search box and then Add All to Selected. I use a large test name and a partial test name:
9__Checks if all the firewall rules related to the Network Discovery group are disabled, 2_
Here is a partial capture of the dialog (not the best colors combination ;) :
EDIT: Please edit the search text to not include the word Acces or Accès, so it is only Contextuel_REFSITE.
Another problem (could be a bug in RIDE) is the documentation having latin characters, and the search function become broken.
The tab Tag Search, will only search by tags, and then you have the option to add to Included or to Excluded tests.
Note: It is very important to confirm the version of RIDE you are using (Tools->View RIDE Log).

Tosca: searching / bulk renaming Test Configuration Parameters

I can't find a way to search for TCPs / search TCP usages / renaming all TCPs.
Let's assume I have a 'licensePlate' TCP set up on the highest level of the hierarchy, and that I have 2 subfolders. In one of them I use the value as it is, in the other folder I change the value. I have some libraries using 'licensePlate'.
I then proceed to rename the TCP to 'carId' on the highest level (and in the libraries). The folder which inherited it will be updated. But the other one will now have two TCPs. This is illustrated in the figure below.
So at the moment I need to manually go into all my subfolders/testcases, find all of them where 'licensePlate' was re-configured, and: (1) set the value to the new param ('carId'); (2) delete the old param ('licensePlate').
The logic behind this imho is that I may still be using that param name (e.g. if I resolved my libraries). Still, I'm guessing that there must be a way to bulk-rename or at least to search for TCP usages (?)
That is really tricky and abstruse. You can find TCP usage with following TQL (Home - Search - TQL Search tab)
=>SUBPARTS[(param_name!="")]
where "param_name" is the name of your parameter.
And it seems that only usages are being found where values has been changed and are not default values.

Vimperator: Follow hint in new tab and switch to it

I am trying to find a strategy in the Vimperator-logic for opening a link to a new tab and switch to it immediately.
I guess this might be a TMTOWTDI.
My first approach would be to start off with a :command sequence. Unfortunately F - Follow hint in background tab - has no equivalent in the command mode. The best solution for me would be without any change in default behaviour whatsoever.
Another approach might be to combine the default F with switching to next tag gt. This would have to include to pass the parameter for F, say 10 for the tenth link of the document. Unfortunately F10gt does open the tenth link but without switching to the newly opened tab.
A third approach does come to mind when using focus elements: ;y10 yank the destination link, :tabopen + paste clipboard content.
Any ideas of what is doable and the easiest?
This functionality exists as a mode of the hint function. Pressing ;t
will produce the desired result. If you want to map it you can also access the javascript directly.
:js hints.show("t")

Filter at event viewer by data

I want to get event entries by their description (data).
I know how to get the event entry with a certain description, however I want to get an entry whith a description which contains a string (not equals to it).
That, I don't know how to do.
Please help :)
According to my answer here: https://stackoverflow.com/a/34119006/5089204 you should be able to retrieve EventRecords.
Dealing with these events is a quite complex issue... Each event has its own internal structure. The common properties are bundled in EventRecord, but the specific data must be taken from the internal details. Use the ToXml() method of an EventRecord...
In order to get the right events you must define an EventLogQuery. You must know the Provider's name and specify the filter.
Try the following: Open eventvwr and there the Windows-System queue. Right click one event, open the "Details" and choose the "XML-View". Look over different events and you will find, that they are quite differing.
But: You'll find everything you need there: First the "Provider Name" and the "EventId", these two are most important for the `EventLogQuery'.
Now go to the "define a user filter on the current protocoll"-action and type in some values. Then switch to the filter's XML and you'll learn how to define the correct query.
I'm sorry, there is no "easy and general" approach :-)

How to restrict text length of a field while in WordPress editor?

I would like to restrict the fields while creating a new post in WordPress. For the title, it should not exceed 40 characters. For the content, it should not exceed 400 characters. If these maximum values are exceeded, I would like to show an error message and not let the user continue. How do I do that in WordPress?
You should be able to use wordpress filters to modify the code that gets outputted when the editor is called. Essentially you would want to use it to insert some javascript and an extra div tag to display your error, then just read the contents of the "editorcontainer" id and show the error once it reaches a certain character limit.
I don't have the time at the moment to write a case example, but depending on your skill level, the functions you are looking for are:
apply_filters("the_editor", "customfunction_limitarea");
Where customfunction_limit area is your created function to insert the javascript. You can see how the_editor is currently called and how the default filters are applied in "wp-includes\general-template.php" on line 1822. The default looks like this:
$the_editor = apply_filters('the_editor', "<div id='editorcontainer'><textarea rows='$rows'$class cols='40' name='$id' tabindex='$tab_index' id='$id'>%s</textarea></div>\n");
I would try modifying that statement by placing a new filter in a functions.php file located in your themes directory, that way you don't have to worry about it getting over-written during an update. Otherwise, if you absolutely have to edit the wordpress core (generally a no-no), general_template.php would be the place to do it I think.
Essentially just read up on wordpress filters a little bit (be warned there's not a ton of documentation or examples available for it other than the basic stuff), and that should provide everything you need. The input verification end is easy enough to find scripts, just google jquery post limiting. Something like this might be exactly what your looking for:
http://swiki.fromdev.com/2010/02/jquery-maximum-limit-texttextarea-with.html

Resources