English
Forum

alphabetical Sorting and Dubletten-Eliminierung

 

Hans
Hermann
Hello!
gives it somewhere a (possible simple) Possibility (z. B. How in Perl), Textzeilen of/ one TXT-File alphabetical To sort and at the same time on semidetached-Lines To to check on and To bereinigen?
Vielen Thanks!
Hans
 
10/22/11  
 




Jörg
Sellmeyer
Hello Hans,

i'd The Textdatei in a (unsichtbare) sortierte Listbox invite and then with GetString each Lines vergleichen. thereby will need you then always only benachbarte Lines vergleichen and discovered double rausschmeißen.
Greeting
Jörg
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
10/22/11  
 



Jo: [...] 
 
10/23/11  
 




Julian
Schmidt
here one View source To Jörgs suggestion...
CompileMarkSeparation
Proc AddTextFileToListBox

    Parameters liste&,file$,reset%
    Declare tempedit&,size&,anzahlzeilen%,i%,buf#
    FindFirst$(file$)
    Case %IOResult: Return 0
    Case reset%: SendMessage(liste&,$0184,0,0)'ListBox je nach Option leeren
    Let tempedit&=Create("MultiEdit",GetActiveWindow(),"",0,0,0,1)
    Set("FileMode",0)
    Assign #1,file$
    OpenRW #1
    size&=GetFileSize(#1)
    Dim buf#,size&+1
    BlockRead(#1,buf#,0,size&)' Dateiinhalt einlesen...
    CloseRW #1
    SendMessage(tempedit&,$0C,0,buf#)'... und in  temp. Edit schreiben
    anzahlzeilen%=SendMessage(tempedit&,$0BA,0,0)
    Dispose buf#

    While i%<anzahlzeilen%

        AddString(liste&,GetString$(tempedit&,i%))
        Inc i%

    Endwhile

    DestroyWindow(tempedit&)' temp. Edit freigeben
    Return 1

EndProc

Proc Delete_Double_Entries

    Parameters liste&
    var counter%=0

    while counter%<>Getcount(liste&)-1

        if GetString$(liste&,counter%)=GetString$(liste&,counter%+1)

            DeleteString(liste&,counter%)

        else

            counter%=counter%+1

        Endif

    Endwhile

    Return 1

EndProc

Cls
var listbox&=Create("ListBox",%hwnd,1,0,30,width(%hwnd),height(%hwnd)-30)
AddTextFileToListBox(listbox&,$WinPath+"\WIN.INI",1)

whileloop 10

    AddString(listbox&,"Das ist ein Test")

Endwhile

print "Win.ini + 10 mal den String 'Das ist ein Test' eingeladen..."
waitinput
Delete_Double_Entries(listbox&)
print "Doppelte Listebox-Einträge entfernt"

While 1

    WaitInput

s4 href='./../../funcion-referencias/XProfan/endwhile/'>Endwhile


The procedure AddTextFileToListBox stammt generally from [...] 

[OFFTOPIC]hmm...If was faster [/OFFTOPIC]


LG

Julian57
 
XProfan X2
Win7 Home Premium, SP1, AMD Athlon(tm) II Neo K125 Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
10/23/11  
 



iF (23.10.11)


simply with the Search supra time "doppel" prompt.

@Julian: integrally beautiful umständlich.

rather mere with input in link with addString or still fgc (file_get_contents) ( [...]  ) and then explode and MoveArrToList.
 
10/23/11  
 



cordial Thanks!!

Hans
 
10/23/11  
 




Julian
Schmidt
iF (23.10.11)

@Julian: integrally beautiful umständlich.
rather mere with input in link with addString or still fgc (file_get_contents) ( [...]  ) and then explode and MoveArrToList.


I say Yes I Have The procedure just übernommen.....[...] 
can already his the it leichter goes. was even one old View source
 
XProfan X2
Win7 Home Premium, SP1, AMD Athlon(tm) II Neo K125 Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
10/23/11  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

7.174 Views

Untitledvor 0 min.
Hans Hermann05/07/15
Klaus Ernst08/25/14
RudiB.11/08/12
Torben Nissen03/11/12
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie