Have a Master file (Master.txt) where each row is a string defining an HTML page and each field is tab delimited. The record layout is as follows:
<item_ID> <field_1> <field_2> <field_3>
1 1.html <html>[content for 1.html in HTML format]</html> <EOF>
2 2.html <html>[content for 2.html in HTML format]</html> <EOF>
3 3.html <html>[content for 3.html in HTML format]</html> <EOF>
The HTML page is defined in <field_2>
. <field_3>
may not be necessary, but included here to indicate the logical location of end_of_file.
How to use awk
to generate a file for each row (which begins with <item_ID>
) where the content of the new file is <field_2>
and the name of the new file is <field_1>
?
Am running GNUwin32
under Windows 7
and will configure an awk
solution to execute in a .bat
file. Unfortunately can't do pipe-lining in Windows, so hoping for an single-awk-program solution.
TY in advance.