Results 1 to 5 of 5
1. I need guide on how to create a folder name from the text file with .txt format.
2. First, I call the function of reading the directory.
3. Then, ...
- 06-23-2010 #1Just Joined!
- Join Date
- Jun 2010
- Posts
- 5
Create folder name from the text file
1. I need guide on how to create a folder name from the text file with .txt format.
2. First, I call the function of reading the directory.
3. Then, I dont know how to do.
4. Finally, I close the directory
This is my source code in perl
## read text.txt file ##
open F, "from/$directory/text.txt";
read F, $buf, 9999;
close F;[/size]
This source code is used to print the folder with date format like "ddmm" d stands for day and m stands for month
if ($command =~ s/-O "(.*)"/-O "$websites\/$month\/$file"/)
Instead, I want to have the name from text.txt to be folder name
- 06-23-2010 #2
So, to rephrase your question: you have a text file containing records that are to be used as directory names, and the directories need to be created as read from that file?
Please post a sample of the text file, using [CODE] tags.
--- rod.Stuff happens. Then stays happened.
- 06-23-2010 #3
Roughly this way:
Code:#!/bin/bash LetSee="ls -l " ExeCute="" cat DirList.txt | while read line; do ExeCute=$LetSee${line}; $ExeCute; done;
- 06-25-2010 #4Just Joined!
- Join Date
- Jun 2010
- Posts
- 5
Thanks for reply. Your rephrase is correct, it is what i wanted to tell. I will use the code u provided. If any problem, I reply u again. Thanks again.
- 06-25-2010 #5
This might be cleaner. If the list of directory names is 'dirs.txt', and is formatted one directory name per line:
--- rod.Code:while read dirname; do mkdir -p $dirname; done < dirs.txt
Stuff happens. Then stays happened.


Reply With Quote