Using extracted text to create a new filename 
Author Message
 Using extracted text to create a new filename


Quote:


>> I have a text file that contains a list of filenames. I would like to
>> use awk to extract each filename from the list and automatically use
>> that name to create a new file for each entry.  Any help would be much
>> appreciated.

>  awk '{ print $1 >$1 }' list_of_filenames

>writes all the filenames from column 1 of "list_of_filenames" in files
>with the same name.

>  awk '{ printf("") >$1) }' list_of_filenames

>creates empty files...

You should probably close the file or you might run out of
filehandles (depending on the version of awk used).  In any case,
using the close() function is just good housekeeping.

Chuck Demas
Needham, Mass.

--
  Eat Healthy    |   _ _   | Nothing would be done at all,

  Die Anyway     |    v    | That no one could find fault with it.



Tue, 06 Aug 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. How I create a new file. ( .\CS\FILENAME)

2. Extracting Text file contents using Python

3. Using variable filename(!FILENAME)

4. HOW TO Create new module from source text

5. Creating text files using sockets

6. Using Text Encoding to create UTF-8 output?

7. Using API to create new controls that are not available in CW

8. Help in using CW2.003 to Create a new directory

9. Using REXX to create new objects in OS/2 with Desktop Observatory

10. Using the CMF to create new roles.

11. Create new using tk_getOpenFile?

12. Creating a new variable using an existing variable

 

 
Powered by phpBB® Forum Software