scottpeter
Programmer
I have a text file in the following format. It contains number of file names and the contents for those files. The file name is commented out with '//'.
//FILE1.txt
CONTENTS OF FILE1
//FILE2.txt
CONTENTS OF FILE2
//FILE3.txt
CONTENTS OF FILE3
//FILE10.txt
CONTENTS OF FILE10
//FILE11.txt
CONTENTS OF FILE11
I need to read FILE1_name in the comments, create a file called 'FILE1_name' and paste the contents of that file into the file 'FILE1_name'. Then I need to do the same for FILE2_name and so on till the end of the file.
Hence in the above case, I need to have the following 5 files in the end
FILE1.txt. This will contain 'CONTENTS OF FILE1'
FILE2.txt. This will contain 'CONTENTS OF FILE2'
FILE3.txt. This will contain 'CONTENTS OF FILE3'
FILE10.txt. This will contain 'CONTENTS OF FILE10'
FILE11.txt. This will contain 'CONTENTS OF FILE11'
Can somebody help with with how to achieve this.
Thanks,
Pete
//FILE1.txt
CONTENTS OF FILE1
//FILE2.txt
CONTENTS OF FILE2
//FILE3.txt
CONTENTS OF FILE3
//FILE10.txt
CONTENTS OF FILE10
//FILE11.txt
CONTENTS OF FILE11
I need to read FILE1_name in the comments, create a file called 'FILE1_name' and paste the contents of that file into the file 'FILE1_name'. Then I need to do the same for FILE2_name and so on till the end of the file.
Hence in the above case, I need to have the following 5 files in the end
FILE1.txt. This will contain 'CONTENTS OF FILE1'
FILE2.txt. This will contain 'CONTENTS OF FILE2'
FILE3.txt. This will contain 'CONTENTS OF FILE3'
FILE10.txt. This will contain 'CONTENTS OF FILE10'
FILE11.txt. This will contain 'CONTENTS OF FILE11'
Can somebody help with with how to achieve this.
Thanks,
Pete