Author Topic: Изменение фраз в payload  (Read 2908 times)

0 Members and 1 Guest are viewing this topic.

mr.niki

  • Contributor
  • ***
  • Posts: 84
  • Karma: 1
    • View Profile
Изменение фраз в payload
« on: March 18, 2016, 02:13:56 PM »
tell me how to do it.
there peyload: in which the phrase = filename and enter values = path to the file
example:
phrase-orange path - d / table / orange.txt
watcher plugin
creates event renaming
where I can take the file name as a new phrase to open the file.
But how to change the old phrase peyloud a new one?
Or completely delete (remove) a 1  line from  peyload?
You can consider the option cards.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Изменение фраз в payload
« Reply #1 on: March 18, 2016, 04:40:15 PM »
It sounds like you want to remove a payload from a payloadXML file.  Is that correct?

It is possible to do that using File.Read, Results.RegexReplace and File.Write.

But I'm not sure this is the best way to do it.

How many payloads are in the payloadXML file?

What is the purpose of this?  What are you trying to accomplish?

It might be better to rescan all the files in the folder into a new payloadXML file.

mr.niki

  • Contributor
  • ***
  • Posts: 84
  • Karma: 1
    • View Profile
Re: Изменение фраз в payload
« Reply #2 on: March 19, 2016, 02:03:06 AM »
I work with different projects.
i has a specific folder where they are created.
peyloud there that I use to open.
example:
Open Projects apelsinka
 path d/ apelsinka
I rename it Fail Projects in apelsinka to projects 1256
plug it sees
and I would like to change the way in peyloud

and change the phrase

1 peyload = 50- 75 phrases
the way in almost all the same
d /Work/Projects 54.txt --- Projects 54
d /Work/Projects 55.txt --- Projects 55

or as I understand you are offering to erase peyload after renaming and re-scan the folder



how to remove line 1 or line 2 to replace it
1 line no longer exists
« Last Edit: March 19, 2016, 03:19:54 AM by mr.niki »

mr.niki

  • Contributor
  • ***
  • Posts: 84
  • Karma: 1
    • View Profile
Re: Изменение фраз в payload
« Reply #3 on: March 19, 2016, 02:37:48 AM »

if I understand you correctly . I made this team , and it works, but with a small number of files
I try to add it to the main team

mr.niki

  • Contributor
  • ***
  • Posts: 84
  • Karma: 1
    • View Profile
Re: Изменение фраз в payload
« Reply #4 on: March 19, 2016, 04:00:23 AM »
HAPPENED
Look maybe you offer a true way


there was only one question:
  how to erase one specific line?
if you know
value and terms for this line
« Last Edit: March 19, 2016, 07:11:12 AM by mr.niki »

mr.niki

  • Contributor
  • ***
  • Posts: 84
  • Karma: 1
    • View Profile
Re: Изменение фраз в payload
« Reply #5 on: March 19, 2016, 04:05:39 AM »
if it is possible in the following versions , add the ability to delete a particular line of peyloud

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Изменение фраз в payload
« Reply #6 on: March 19, 2016, 09:33:26 AM »
if I understand you correctly . I made this team , and it works, but with a small number of files
I try to add it to the main team

Yes this command should work fine.  You do not need to use VC.Pause.  Remove that action.

You do not need to use variables in that way but for the sake of an example it is fine.

You have solved the problem.

If you want, you can use the same method to delete a payload.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Изменение фраз в payload
« Reply #7 on: March 19, 2016, 12:19:12 PM »
If you just want to rescan all your files you can use something like this.  The advantage is that this will work even if files change when VoxCommando is not running.

The example below will scan ALL FILES AND SUBFOLDERS of the path specified. So be careful.  Do not use this on a folder like C:\ because it will scan your entire hard drive.

If your files are constantly changing and this command takes too long to execute then you should probably continue using the Results.RegexReplace method.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.7-->
<command id="224" name="regenerate payload xml from directory scan (RECURSIVE)" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>PayloadXML.Clear</cmdType>
    <params>
      <param>payloads\ProjectFiles.xml</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>File.GetFiles</cmdType>
    <params>
      <param>J:\projects</param>
      <param>*.docx</param>
      <param>True</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.MatchConcat</cmdType>
    <params>
      <param>{CR}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>(\w.+\\(.*?).docx)</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.MatchToXML</cmdType>
    <params>
      <param>payloads\ProjectFiles.xml</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <event>file changed event</event>
  <phrase>rescan my project files</phrase>
</command>

mr.niki

  • Contributor
  • ***
  • Posts: 84
  • Karma: 1
    • View Profile
Re: Изменение фраз в payload
« Reply #8 on: March 19, 2016, 01:25:13 PM »
yes it is an interesting option thanks but how to make it more universal?
https://youtu.be/x1TcNsHhkZ0

for example, in the video you can see how my team is working
with this line:
  (.*?).[txt,xlsx,docx]

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Изменение фраз в payload
« Reply #9 on: March 19, 2016, 01:39:30 PM »
I don't understand ANY Russian at all, so I cannot understand anything you say in your video.

If you need to learn how to use regular expressions, I suggest you use the wonderful internet which will provide you with endless information on how to use regular expressions.

For example, one quick search (even though I don't speak any Russian) led me to this page: https://msdn.microsoft.com/ru-ru/library/az24scfc(v=vs.110).aspx

Maybe you can look at that, but I think if you use Google you can find a much better guide written by Russian speaking people.
« Last Edit: March 19, 2016, 01:41:46 PM by jitterjames »

mr.niki

  • Contributor
  • ***
  • Posts: 84
  • Karma: 1
    • View Profile
Re: Изменение фраз в payload
« Reply #10 on: March 19, 2016, 02:43:50 PM »
(\w.+\\(.*?).(?:txt|docx|xlsx))

thank you specify what to look for, I tried it and it works. I do not know how to properly !!
« Last Edit: March 19, 2016, 02:45:57 PM by mr.niki »