Total Commander Forum Index Total Commander
Форум поддержки пользователей Total Commander
Сайты: Все о Total Commander | Totalcmd.net | Ghisler.com | RU.TCKB
 
 RulesRules   SearchSearch   FAQFAQ   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Single Post  Topic: Автоматизация программы по списку 
Author Message
Slamzor



PostPosted: Fri Jun 14, 2013 20:19    Post subject: Автоматизация программы по списку Reply with quote

Здравствуйте!

Мне необходима автоматизация процесса.

У меня есть программа, которая в текстовых документах вносит изменения. Работает по следующему принципу - задал ей файлы (можно различными способами) и она работает по принципу найти и заменить. Программа поддерживает открытие нескольких окон.

Пример: В каждом из трех документов(названия файлов разные) есть одинаковый текст "А" и надо заменить этот текст "А" в каждом документе на текст из списка, т.е. в первом документе "А" на "B", во втором "А" на "C", в третьем "А" на "D".
Программа поддерживает работу по спискам. Иначе говоря, можно задать список обрабатываемых файлов и список что найти ("А") и на что заменить ("?"). Так как у меня текст "А" во всех документах, мне необходимо чтобы программа произвела замену константы "А" на некоторое значение из списка для каждого файла в отдельности. То есть взяла первый файл и заменила на первое значение из списка "Найти\заменить", затем второй файл и второе значение из списка и так N количество раз.


Вот что нашел в хелпе к программе на английском:

Code:
WordPipe can be run from a DOS shell or from a shortcut with parameters to make it run automatically. This is very useful for automation and scheduling (by making the short cut an entry in the Start Up folder), and for running WordPipe from a batch file. Here is a complete example:

"C:\Program files\WordPipe\wordpipe.exe" "/f=my replaces.wpp" /G /Q

Note:

Any commands with embedded spaces must be surrounded with double quotes. You must surround the entire command/setting combination e.g. "/f=c:\Program Files\WordPipe\my replacements.wpp" NOT /f="c:\Program Files\WordPipe\my replacements.wpp"
Windows limits the command line length to about 260 characters. You can overcome this limitation by using the /Z=<filename> command to load command line parameters stored in a file. Note that you MUST remove any double quotes from around commands with embedded spaces when you put them in the command file.
Conventions used below:

<> surrounds text that is to be entered. Do NOT enter the '<' and '>' characters

Alternatives are shown in square brackets '[' and ']' with a pipe '|' character between them. Do NOT enter the square brackets or the pipe character - just type the single alternative you require.

Usage:

"C:\Program files\WordPipe\wordpipe.exe" [/MINIMIZED|/MAXIMIZED] ["/F=my replaces.wpp"] [commands] [/G [/Q]]
Where [commands] is zero or more of:

/F=<.wpp filename> Opens a WordPipe settings file. 
/REPORT=<report filename> At the conclusion of the job, a text file report is written to the given filename. The /REPORT parameter must be after any /F command and before the /G command.
/G Go. Begin processing replacements with WordPipe. Processing of the command line does not continue until the processing job is complete.
/GS Same as /G, but search only mode.
/I=<filename> Imports a search/replace list from Excel, Tab or CSV-delimited file, and adds it to the end of the grid. The current options settings are used for each row added.
/MAXIMIZED Opens the application maximized.
/MINIMIZED Opens the application minimized.
/Q Quit WordPipe at the end of processing. The current settings are not saved.
/Z=<filename> Read command line parameters from the specified file. Very useful for performing large numbers of changes, or for working around the Windows limitation of approx 260 characters on the command line.
For example, if you had the long command line

start /w wordpipe.exe "/f=my special filter.wpp" /g "/f=my special filter2.wpp" /g "/f=my special filter3.wpp" /g "/f=my special filter4.wpp" /g /q

This would change to something like

start /w wordpipe.exe /z=commands.txt

and the file commands.txt would contain

/f=my special filter.wpp
/g
/f=my special filter2.wpp
/g
/f=my special filter3.wpp
/g
/f=my special filter4.wpp
/g
/q
 



Написал разработчикам, ответили что можно из командной строки, но вот как - не сказали ...
Их ответ:
Quote:
No, you'd need 2 separate runs. You can automate this from the command line if you need to.


Можно как то уточнить, как из командной строки заставить программу произвести данные действия?
View user's profile Send private message


Powered by phpBB © 2001, 2005 phpBB Group