Text Duplicates of the Item in a List Box or Dropdown List - Forum

Forum Navigation
You need to log in to create posts and topics.

Text Duplicates of the Item in a List Box or Dropdown List

Help, les Amis
After merging two .Txt files
file 1 and file 2 in a single file named 3 it is then transmitted to a List Box or a Drop-down List,
No problem, all the info in file 1 and file 2 can be found in file 3 in .Txt format
However, there may be duplicates. For example apple from file 1 and apple from file 2
We have 2 times apple in the Txt 3 file and therefore in the List Box or the Dropdown List. How to keep only one of the two duplicates in the 3.Txt file and in the List Box or the Dropdown List?
keep only once apple instead of apple apple.
Thank you for any directions or ideas ... I block

Claude GUYOT
NeoBook en Français Version : 5.8.7

Doublons Text de l'Item dans une Zone de Liste ou Liste Déroulante

Après avoir fusionné deux fichiers .Txt
le fichier 1 et le fichier 2 en un seul nommé 3 il est ensuite transmis dans une Zone de Liste ou une Liste Déroulante,
Pas de problème, toutes les infos du fichier 1 et du fichier 2 se retrouvent dans le fichier 3 au format .Txt
Par contre il peut y avoir des doublons. Par exemple pomme du fichier 1 et pomme du fichier 2
Nous avons 2 fois pomme dans le fichier Txt 3 et par conséquent dans la Zone de Liste ou la Liste Déroulante. Comment ne garder que un des deux doublons dans le fichier 3.Txt et dans la Zone de Liste ou la Liste Déroulante?
ne garder qu'une fois pomme au lieu de pomme pomme.
Merci pour toutes orientations ou idées ... Je bloque

Claude GUYOT
NeoBook en Français Version : 5.8.7

There are several ways to do it. Perhaps the simplest are these two.

You can put file 1 in the listbox and check line by line in file 2 by comparing each value with the values in the listbox. If the value is not repeated, you add it to the listbox. If ordered alphabetically, each value will be put in place.

Another option is to do the same thing, but with each file in a different listbox. You can hide them while the process is taking place (or put them outside the window). If the value in the second listbox is not in the first listbox, it is added. This method is faster since the two files would be in memory instead of accessing the hard disk.

I hope it helps.

Bonsoir Gaev, CN_Iceman,
bonsoir Membres du forum.

Merci Gaev, ça marche très bien.
Réponse et solution parfaites.

J'étais partis sur une autre piste, après fusion des deux fichiers je cumulais des doublons ...

FileToVar "[PubDir]1.txt" "[ListBox1]"
FileWrite "[PubDir]3.txt" "All" "[ListBox1]"
FileToVar "[PubDir]2.txt" "[ListBox2]"
FileWrite "[PubDir]3.txt" "Append" "[ListBox2]"
.récupération du contenu des fichiers 1 et 2 dans 3
FileToVar "[PubDir]3.txt" "[ListBox3]"
... Je n'arrivais pas à garder qu'un des doublons
...
EndIf

 

Merci CN_Iceman pour ta réponse au fil.

Merci pour l'ensemble de vos aides.
Au plaisir de revenir vers vous.

Claude GUYOT
NeoBook in French Version: 5.8.7

-------------------------------------------------------

Good evening Gaev, CN_Iceman,
Good evening Members of the forum.

Thank you Gaev, it works very well.
Perfect answer and solution.

I went on another track, after merging the two files I accumulated duplicates ...

FileToVar "[PubDir]1.txt" "[ListBox1]"
FileWrite "[PubDir]3.txt" "All" "[ListBox1]"
FileToVar "[PubDir]2.txt" "[ListBox2]"
FileWrite "[PubDir]3.txt" "Append" "[ListBox2]"
.recover the contents of files 1 and 2 in 3
FileToVar "[PubDir]3.txt" "[ListBox3]"
... I couldn't keep one of the duplicates and delete the others
EndIf

Thank you CN_Iceman for your response to the thread.

Thank you for all of your help.
Looking forward to coming back to you.

Claude GUYOT
NeoBook in French Version: 5.8.7