Hello!
I need to realize such task.
1. In my user's home dir I have folder1;
2. In folder1 I have some (various count) subfolders with random names;
3. In these subfolders I have one file anyname.pdf (various name in each subfolder) and file content.txt (constant name in each subfolder)
## If in subfolder more than one .pdf or more than one .txt file, I must miss this subfolder (move it to Folder3 - it's one of the folders of my user's home dir) ;
So,
4. I must to scan every subfolders in folder1,
enter in each one;
5. If this subfolder has more than one .pdf file or more than one .txt file, I must go to next subfolder (with moving this subfolder to Folder3);
6. In «good» subfolders I must take file content.txt;
7. It has such structure:
dfdf{some trash}wqwq
begin_of_useful_info
info info ... info
end_of_useful_info
dfdf{some trash}wqwq
8. In this file content.txt I must find and cut only «useful_info» (between begin_of_useful_info and end_of_useful_info,including it):
begin_of_useful_info
info info ... info
end_of_useful_info
( begin_of_useful_info and end_of_useful_info is key-words on each content.txt, it must be cutted too)
9. this info I must put in new .txt file with name as .pdf file in this subfolder!
Example:
In folder1/4323353/ I have files GHTY34.pdf and content.txt. So, after operation I must get a file GHTY34.txt with useful_info)
10. delete parsed file content.txt
(so, now I have again two files in subfolder somename.pdf and somename.txt)
11. then I must copy files .pdf and new .txt with similar names somewhere, for example in folder2 (my user's home dir) and delete analized subfolder.
12. Go to next subfolder.
That's all
Thanks!
Ответ на:
комментарий
от stevejobs
Ответ на:
комментарий
от Jetty
Ответ на:
комментарий
от stevejobs
Ответ на:
комментарий
от ky-san
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.
Похожие темы
- Новости Microsoft получила патент на 'desktop pager' (2004)
- Форум Луна, хеви лифты, успешные и молодые, вот это вот всё... (2017)
- Форум [announce] BFS - Brain Fuck Scheduler: Возвращение анастезиолога (2009)
- Форум Шо, опять починили? (2013)
- Форум осторожно CUPSец 1.6 надвигается (2012)
- Форум Требуется помощь с shell скриптом (2012)
- Форум Вопросы по Snap / Snapcraft (2016)
- Форум 11 мая 2014 года в 11:20-30 по MSK большая игра в freeciv (2014)
- Форум «xmpp.core.im» is now routed to null. (2012)
- Форум Помогите с Shell програмкой (2012)