I have a large file containing approx 1000+ file contents of similar type. The file looks like below:
<c> ================================== $ cat large_file < file1.txt line1 of file1 line2 of file1 line3 of file1 line4 of file1 < file2.txt line1 of file2 line2 of file2 line3 of file2 < file3.txt line1 of file3 line2 of file3 line3 of file3 line4 of file3 ==================================
I need to create files file1.txt, file2.txt and file3.txt from this large file. The format of actual file is exactly the same hence "<" can be used as file separator and "file1.txt" , "file2.txt" and "file3.txt" should be the outcome.
I can write a shell script using some complex awk/sed functions after devoting couple of hours :-) but I am sure that perl should have small and handy solution for this. Can anyone help me in this?
Thanks.
In reply to How to generate files based on some special character? by unix_95054
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |