Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Problem with FC DOS command on Windows XP


  • Please log in to reply

#1
jayeshn

jayeshn

    New Member

  • Member
  • Pip
  • 1 posts
Hi,
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.
  • 0

Advertisements


#2
bdlt

bdlt

    Member

  • Member
  • PipPipPip
  • 876 posts
see if there are any '/n' occurances in the xml file. the java code might see that as the end-of-line character.

the counter is already off by 18 lines at line 81. if there are fewer than 18 '/n' in the xml file in the 1st 81 lines, add a System.out.println() statement to the code and display the 1st 81(or fewer) lines. start with the first line that is counted wrong, fix it and repeat until the count is correct.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP