I am not sure if this is the appropriate place for my question. Nonetheless I am posting it as below:-
I am using the fc command from Windows to make a file compare tool. I know that there are a lot of File Compare tools already available, but I am being silly here and developing my own. Please pardon me for that.
Here is the problem I am facing. I have a Java application which generates two text files after parsing two xml files. I run the fc command to compare the two text files generated. My command is as follows -
fc /a /n /w /l
This shows me the output in an abbreviated format with the line numbers. The problem here is the line numbers are not in sync with the actual line numbers in these files. For eg my output is as follows -
***** MQ_Flow1_Rpt10_10_2005_04_29_36.txt
99: Input Connections -
100: ResetContentDescriptor3 - 2f00b27f-fc00-0000-0080-bf0d9797fbba
101: Output Connections -
***** MQ_FLOW2_RPT10_10_2005_04_29_36.TXT
99: Input Connections -
100: UpdateGlobalLimit - f3a79b57-fc00-0000-0080-bf0d9797fbba
101: Output Connections -
*****
***** MQ_Flow1_Rpt10_10_2005_04_29_36.txt
108: Output Connections -
109: ResetContentDescriptor3 - 2f00b27f-fc00-0000-0080-bf0d9797fbba
110: ******************************************************
***** MQ_FLOW2_RPT10_10_2005_04_29_36.TXT
108: Output Connections -
109: UpdateGlobalLimit_MRM2XML - e65fa557-fc00-0000-0080-bf0d9797fbba
110: ******************************************************
*****
***** MQ_Flow1_Rpt10_10_2005_04_29_36.txt
804: SET OutputDestinationList.Destination.RouterList.DestinationData.lab
elname = 'UpdateGlobalLimit';
...
807: SET OutputRoot.MQRFH2.mcd.Fmt = 'CWF';
***** MQ_FLOW2_RPT10_10_2005_04_29_36.TXT
804: SET OutputDestinationList.Destination.RouterList.DestinationData.lab
elname = 'UpdateGlobalLimit';
...
807: SET OutputRoot.MQRFH2.mcd.Fmt = 'CWF';
*****
***** MQ_Flow1_Rpt10_10_2005_04_29_36.txt
1097: ******************************************************
...
1109: Reset Message Type: true
***** MQ_FLOW2_RPT10_10_2005_04_29_36.TXT
As per the command the difference begins at line # 99. But the lines at line # 99 are exactly the same. The difference actually is on line # 81. Interstingly the text shown in the difference is correct, but the line number is not. The other line numbers also are totally off the actual difference. Infact the files only contain a maximum of 1024 lines whereas the command shows 1109. Even if I use the FC /n <file1> <file2> I get the same output.
Please help me out in finding the reason for this discrepancy. I need to solve this problem in order to complete my tool. I would really appreciate if someone can provide me the reason why the line numbers in the output of the FC command are not as per the actual differences.