Jump to content

duplicated line ?


Recommended Posts

Hi.

I'm have a file that containes around 45 lines , some are exactly the same . example :

line 1 087733445

line 2 A55224689

line 3 087733445

line 4 F44522652

what i am triyng to do is check if a certain line exists 2 or more times in this file.

i think it can be done be filereadline and then puting that line in an array, but i am still confused and don't know how to do this .

can somebody help me plz ??

Link to comment
Share on other sites

  • Developers

Should work fine for smaller files:

#Include<File.au3>
Dim $InputRecords
_FileReadToArray("Test.txt",$InputRecords)
For $x = 1 to $InputRecords[0]
    For $y = 1 to $x-1
        If $InputRecords[$x] = $InputRecords[$y] Then
            ConsoleWrite("Record " & $x & " is a duplicate of record " & $y & @LF)
        EndIf
    Next
Next

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...