I have a list of filenames that I want created - they must be created via a certain naming convention due to the software I'm using. Once they are created I have another file that will be used to populate them with data. So far this is what I have:
For example, foo_txt would contain the following:
And four files would be created. bar_txt would contain the following:
Some of the lines from bar_txt would be appended to a file created from foo_txt which is why I'm using the ">>", and that's why the files from foo_txt would contain more than 1 line from bar_txt - whatever filename is listed in foo_txt at the time each line of bar_txt is read.
Your description was somewhat confusing to me. If I understand what you want, this may get you started:
I avoid using constructs like for x in $(cat some-file) do because the number of lines in the file might exceed the system parm limits, and/or there might be multiple words on the file where only one of which is the desired filename. The using while read does the same thing without these dangers.
I made the assumption that lines from 'bar' were only to be placed into a newly created file if the filename existed, and the line was to be written only to the named file. Thus filea would only get the lines from bar that had filea listed as the second token.
You should be able to augment this example with proper directories etc. and please be advised that I did NOT test this code.
Last edited by agama; 06-19-2011 at 02:48 PM..
Reason: typo
It is confusing and I appreciate your help and decrypting my request. Let me just add a little more explanation. When I originally referred to the "bar_txt" file - that's a file containing a list of /etc/passwd entries. The "foo_txt" file contains the name of the server where the /etc/passwd entry will be created. So, I usually have a "foo_txt" file that has repeating entries depending on how many lines of the bar_txt file will be input to the respective file created from foo_txt. I tried to denote this as the server name is listed in each line of the bar_txt file - it would be where you see "file_a" or "file_b" etc. I probably could have written the question a little better.
In any event I appreciate your reply and I'll give it a chance when I can - just thought I'd throw up a quick post and see if I could get some guidance.
Actually I have many pictures with diferent name and size around 2000, I need generate a copy of them from one list of alias. The structure of the list is something like this:
alias_list.txt
<01>randomname.png<02>
Randomname.png
RandoMname.png
RandOmname.png
RandomnamE.png... (6 Replies)
Gents,
Please can you help.
I want to create a list which contends the complete patch of the location of some directories with the size of each file.
need to select only .txt file
In this case I am try to find the subdirectories tp1 and tp2 and create the output list.
jd175-1
tp1... (3 Replies)
Hello Guys
I have a big list of files in one directory. And Some are missing .
Example
ls -l
2191off-r0.sps
2193off-r0.sps
2194off-r0.sps
2197off-r0.sps
2198off-r0.sps
2200off-r0.sps
I would like to create a file with the list only missing files. Or if is possible to create in ... (4 Replies)
Hello Guys.
Please I would like to create empty files from a list
In file1 will be the followin values, so i will like to create for each name a empty file.
file1
2191off-r0.sps
2192off-r0.sps
2193off-r0.sps
2194off-r0.sps
2195off-r0.sps
So I need to get 5 empty files.
Thanks for... (7 Replies)
I have more than 10K songs in two directories on a hard drive. I would like to create a file list all of files name then change to .xml extension to upload to iPhone so I have a Karaoke list on my iPhone.
I need your help to create a file by using command in Linux.
Files names:
0001 More... (4 Replies)
Hi,
i have say 100 files in a directory.
file1.log
file2.log
file3.log
file4.log
file5.log
file6.log
...
...
...
file99.log
file100.log
=========
I need to create another file which contains the list of al these log files.
each file should contain only 10 log file names.
it shud... (4 Replies)
I would like ot create shell script/ bash to create diffrent files based on a file and parameters list.
Here is the detail example: I have a textfile and four static parameter files (having ‘?'). mainfile.txt has below records (this count may be more than 50)
A200001
A200101
B200001... (9 Replies)
Hi,
I want to put all the deleted files in a txt file. Because i want to backup my image server which has thousands of jpg images. I wrote a shell script which will copies images from image server to backup image server. I setup a cronjob which runs on every five minutes. & through timestamp it... (8 Replies)
Hello Mates! I'm kinda new to unix and need to a solve a problem.
Input: date
Situation: With the given date I need to find a list of all such files starting from a given path that were modified after the given date.
I experimented with the "find" with "-newer" but did not quite get it... (4 Replies)