From: karenmiddleol@...
Date: 2005-10-28T05:52:04+09:00
Subject: How to merge two files like the following with the XML parser
I have two text files.
I want to merge them together as follows:
================================
File1.txt
SCREEN,
PROGRAM,
FIELD1,
VALUE1,
FIELD2,
VALUE2,
FIELD3,
VALUE3,
================================
================================
File2.txt
S1,P1,F11,V11,F12,V12,F13,V13
S2,P2,F21,V21,F22,V22,F23,V23
....
....
================================
Now when I merge the two files together I want the following file:
================================
File3.txt
SCREEN, S1
PROGRAM,P1
FIELD1,F11
VALUE1,V11
FIELD2,F12
VALUE2,V12
FIELD3,F13
VALUE3,V13
SCREEN, S2
PROGRAM,P2
FIELD1,F21
VALUE1,V21
FIELD2,F22
VALUE2,V22
FIELD3,F23
VALUE3,V23
=======================================================
I want a generic script that can merge file1.txt and file2.txt to
generate file3.txt
I want a script that can take a template of File1.txt as follows:
SCREEN, <>
PROGRAM, <
>
FIELD1, < >
in the following form:
================================
File2.txt
< >,<>, <>,<