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 

Автоматизация программы по списку

 
Post new topic   Reply to topic    Total Commander Forum Index -> Программное обеспечение printer-friendly view
View previous topic :: View next topic  
Author Message
Slamzor



Joined: 26 May 2013
Posts: 19

Post (Separately) Posted: 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.


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



Joined: 06 Nov 2009
Posts: 14229
Location: Москва

Post (Separately) Posted: Sat Jun 15, 2013 09:46    Post subject: Reply with quote

А зачем в ПО? С выделенными в панели файлами разве не надо работать?
Темы по поиску/замене имеются.
_________________
Автору сборки TC Image (Andrey_A) настоятельно рекомендуется не распространять на иных ресурсах любую предоставленную мной где-либо техническую информацию по автоматизации и оптимизации в работе с ТС и системой.
Back to top
View user's profile Send private message
Slamzor



Joined: 26 May 2013
Posts: 19

Post (Separately) Posted: Sat Jun 15, 2013 17:24    Post subject: Reply with quote

Видимо Вы не совсем правильно меня поняли. Программа правит текст внутри фалов (МС ВОРД). Если бы текст был разный я бы все поменял за раз. НО! У меня один текст во всех файлах и функционал программы не позволяет выбирать замены для каждого файла в отдельности. Она перебирает файлы по списку1 и заменяет все (внутри тела) что нашлось в списке2.
Back to top
View user's profile Send private message
Flasher



Joined: 06 Nov 2009
Posts: 14229
Location: Москва

Post (Separately) Posted: Sat Jun 15, 2013 18:06    Post subject: Reply with quote

Я как раз всё правильно понял, кроме того, что это файлы MS Word, о чём в первом посте не сообщалось. Замену можно делать и без указанной утилиты. Но мои вопросы другого касались.
_________________
Автору сборки TC Image (Andrey_A) настоятельно рекомендуется не распространять на иных ресурсах любую предоставленную мной где-либо техническую информацию по автоматизации и оптимизации в работе с ТС и системой.
Back to top
View user's profile Send private message
Slamzor



Joined: 26 May 2013
Posts: 19

Post (Separately) Posted: Sat Jun 15, 2013 22:37    Post subject: Reply with quote

Утилит много, но эта одна из лучших. А если поподробней - про возможность проделать это без этой программы...
Back to top
View user's profile Send private message
Flasher



Joined: 06 Nov 2009
Posts: 14229
Location: Москва

Post (Separately) Posted: Sun Jun 16, 2013 01:18    Post subject: Reply with quote

На VBSсript, например.
Можно сделать обработку в цикле двух списков. Но про первый так и не получил ответ.
_________________
Автору сборки TC Image (Andrey_A) настоятельно рекомендуется не распространять на иных ресурсах любую предоставленную мной где-либо техническую информацию по автоматизации и оптимизации в работе с ТС и системой.
Back to top
View user's profile Send private message
Slamzor



Joined: 26 May 2013
Posts: 19

Post (Separately) Posted: Sun Jun 16, 2013 12:41    Post subject: Reply with quote

Ответ на Вопрос про работу на панели с файлами - у меня есть файл в котором часть имени файлов, создаю маску в списках ипрограмма сама отбирает файлы в которые вносить те или инные изменения
Back to top
View user's profile Send private message
Flasher



Joined: 06 Nov 2009
Posts: 14229
Location: Москва

Post (Separately) Posted: Sun Jun 16, 2013 16:00    Post subject: Reply with quote

Можно искать файлы по списку масок в ТС.
А маски сложные? Или только со звёздочками?
_________________
Автору сборки TC Image (Andrey_A) настоятельно рекомендуется не распространять на иных ресурсах любую предоставленную мной где-либо техническую информацию по автоматизации и оптимизации в работе с ТС и системой.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> Программное обеспечение All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group