1 Replies - 1335 Views - Last Post: 30 October 2002 - 03:11 PM Rate Topic: -----

#1 ooosawaddee3  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 34
  • Joined: 25-July 02

How To Check Duplicat Line In Text File?

Post icon  Posted 30 October 2002 - 12:14 PM

I want to chek duplicate line in text file

Example:

If in "1.txt" has this data inside
50B82D3F9D3
2C051C76C7D
5804EBB2BB8
559AAC90CEE
DA64B9F10CC
B9A6A9866A9
AFF45E93F23
.
.
.
.
45788887454
B9A6A9866A9

This above text file has duplicate line

"B9A6A9866A9"

I want to write proram to check duplicate line.
Do you know how to do that? (Now I can use CStdioFile (ReadString, WriteString) and show Messagebox but not have idea to do that.)

Thank you for your answer.

Is This A Good Question/Topic? 0
  • +

Replies To: How To Check Duplicat Line In Text File?

#2 Noffke  Icon User is offline

  • D.I.C Regular

Reputation: 0
  • View blog
  • Posts: 497
  • Joined: 09-August 02

Re: How To Check Duplicat Line In Text File?

Posted 30 October 2002 - 03:11 PM

make each line an entry in an array.
then compare each entry of the array with the rest of the array using nested loops.
to compare use strcmp or write your own compare function that compares each character in the string.

Noffke
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1