text1.txt
XXX XXX XXXX:1234,1111_111,
ABCD 123456,XXXX XXXXXX:12345,XX,YYYYY1,ZZZZZ1,
XXX XXX XXXX:1234,1111_111,
BCDF 123456,XXXX XXXXXX:12345,XX,YYYYY2,ZZZZZ2,
XXX XXX XXXX:1234,1111_111,
CDEF 123456,XXXX XXXXXX:12345,XX,YYYYY3,ZZZZZ3,
text2.txt
ABCD 123456,1111,11111,111111,XX,AAAAAA1,BBBBBB1
CDEF 123456,1111,11111,111111,XX,AAAAAA2,BBBBBB2
BCDF 123456,1111,11111,111111,XX,AAAAAA3,BBBBBB3
Output:
XXX XXX XXXX:1234,1111_111,
ABCD 123456,XXXX XXXXXX:12345,XX,YYYYY1,ZZZZZ1,
XXX XXX XXXX:1234,1111_111,
BCDF 123456,XXXX XXXXXX:12345,XX,YYYYY2,ZZZZZ2,
XXX XXX XXXX:1234,1111_111,
CDEF 123456,XXXX XXXXXX:12345,XX,YYYYY3,ZZZZZ3,
This is the original text file input and it gave the desired output. However with the NewTextFile.txt input below the output is somehow "incorrect" with the same text2.txt.
NewTextFile.txt:
XXXXX XXXXX:123E,1234567_123,
ABCD 123456,XXXX XXXX:123E,X,YYYYY1,ZZZZZ1,
XXXXX XXXXX:213E,2345678_123,
BCDF 123456,XXXX XXXX:123E,X,YYYYY2,ZZZZZ2,
XXXXX XXXXX:321E,3456789_123,
CDEF 123456,XXXX XXXX:123E,X,YYYYY3,ZZZZZ3,
text2.txt
ABCD 123456,1111,11111,111111,XX,AAAAAA1,BBBBBB1
CDEF 123456,1111,11111,111111,XX,AAAAAA2,BBBBBB2
BCDF 123456,1111,11111,111111,XX,AAAAAA3,BBBBBB3
Output:
,XXXX XXXXX:123E,1234567_123,ABCD 123456,XXXX XXX:123E,X,YYYYY1,ZZZZZ1,
,XXXX XXXXX:213E,2345678_123,CDEF 123456,XXXX XXX:123E,X,YYYYY2,ZZZZZ2,
,XXXX XXXXX:321E,3456789_123,BCDF 123456,XXXX XXX:123E,X,YYYYY3,ZZZZZ3,
With the NewTextFile.txt, the first character X is removed and replaced with , (comma) for all new line.
Thank you