LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do we add non-repetitive items to an array

hi all,
 
iam having the following items in a text file, which are going to be inputted to an array(line by line):
 
HALL
BALL
PAUL
CALL
HALL
HALL
 
now what i want is only non-repetitive items should be inserted to the array.In the above example,
HALL
BALL
PAUL
CALL
 
should only be added to the array and since HALL is repeated in the last two lines, it should not be added.
hope i made myself clear.
 
Regards,
santosh
 
 
Regards,
santosh
0 Kudos
Message 1 of 12
(3,709 Views)
The OpenG array tools have a remove duplicates VI.
These tools can be installed with VIPM

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 12
(3,708 Views)

hi ton,

is there any other solution.

currently i am using version 7.1 and i have to run the same code on other machine also.

Even if i install VIPM , i think that i have to install the same on other systems where i want to run my application.

Regards,

santosh.

Regards,
santosh
0 Kudos
Message 3 of 12
(3,706 Views)
Santosh,
in this case I think you'll have to program it yourself. Search the array for the element to add (search 1D-array). If it's already there (index >=0) skip the item, else insert it.
Daniel
Message 4 of 12
(3,700 Views)
Built on how dan has explained
Message 5 of 12
(3,699 Views)

HI DAN AND HI DEV,

the solution provided by devchander is excellent, i could able to convert it into conveninent form and

it is working perfectly, and Dan thank u for providing the algorithm,

cheers guys

Regards,

santosh.

Regards,
santosh
0 Kudos
Message 6 of 12
(3,693 Views)

Hey thanks!

But I would have been happier if dan alone was given 5 stars, rather than we getting 4 stars each !Smiley Wink

Smiley Very Happy

0 Kudos
Message 7 of 12
(3,682 Views)
HI DEV,
 
I THOUGHT OF GIVING 5 TO BOTH OF U GUYS,BUT SINCE I WAS IN A HURRY
I PRESSED 4 INSTEAD OF 5, ANYWAY RATING IS ONLY STATISTICAL, BUT THE
HELP IS IMMEASURABLE
Smiley Happy
 
REGARDS,
SANTOSH
Regards,
santosh
0 Kudos
Message 8 of 12
(3,677 Views)

Hey Santosh,


ANYWAY RATING IS ONLY STATISTICAL, BUT THE

HELP IS IMMEASURABLE

Well said!

Indeed, being able contribute and share knowledge is what matters in this forums!

The stars are just,  Hmm, shall we say 'By-Products'? Smiley Very Happy

All the best to you, Santosh!

Regards,

Dev

0 Kudos
Message 9 of 12
(3,673 Views)


@devchander wrote:

Hey thanks!

But I would have been happier if dan alone was given 5 stars, rather than we getting 4 stars each !Smiley Wink

Smiley Very Happy




Thanks dev Smiley Happy
But he clicked on the rating 2 times anyway so I think 2 times 5 stars would have been appropriote Smiley Wink
To your amount of stars it won't change much in average, but in mine it still does... but anyway, it's just statistics... help is what counts, you're right santosh.

EDIT: 5 stars from me, dev Smiley Very Happy

Message Edited by dan_u on 09-26-2006 03:39 PM

Message 10 of 12
(3,662 Views)