Remove Duplicates From List Or Array
I am returning a list form a db: this could be 1,2,3,4,12,67,1,2,34 so basically I am looking at how to remove the duplicates before doing another select. I saw a thread here with a funciton to do this bu it does not seem to work.
View Replies
ADVERTISEMENT
I am pulling some records out of a database which have a Description field containing several words, and storing this information in an array using GetRows().
Then using a for-next loop I am going through these records and using the Split() function to get the first word of the Description and then adding it as an option to a dropdown list.
The problem is I get lots of duplicates in the drop down because lots of the descriptions have the same first word. Using DISTINCT in the SQL statement won't help much because at that stage the descriptions arent the same. Code:
View Replies
View Related
How to write asp code to remove duplicates in an array.
For Eg: A()=(1,5,10,15,10,20,5)
After removal of duplicates it should be
A()=(1,5,10,15,20).
View Replies
View Related
I have an array like this:Code:
arrColour = split("blue,blue,green,red,purple,blue,green,yellow",",")
What I need to be able to do is to remove all items of the value "blue" from the array. I can just run a dictionary function to delete all duplicate values, because some of them need to be retained. I just need to delete all of them of a particular value. how this can be done?
View Replies
View Related
I have declared a multidimensional array as follows. dim parray(100,5). Now this array contains some duplicate values. So how to remove duplicate values in this multidimensional array.
View Replies
View Related
I have a string like so:
Fruit (apple) (pear) (banana) (pear/orange/apple)
I need a regular expression that will parse it into the following:
apple / pear / banana / orange
i.e. separate them all by a forward slash and remove duplicates.
View Replies
View Related
I have an array which is made up of a selection of place names, such as "London, London, Lisbon, Paris, London, Madrid, London, Madrid", what I need to do is loop through the array and get it to find out which item is duplicated the most times, and then have this item equal to a variable, such as TopPlace, which in this case would be TopPlace = London, I have no idea how to achieves this, could someone offer me any help on doing this?
View Replies
View Related
I have a array arrNames --
Is there any easy way that I can check that no duplicates exist in the array and if there are duplicates return the name that is a duplicate?
View Replies
View Related
i have created an array from recordset containing user names eg. (davidp, davidp, evenf, patricka, rebeccah). which i have sorted in alphabetical order, but i need to
identify duplicates in this array and the number of times it has been duplicated.
View Replies
View Related
Here's my list:
required = "street_name, city, zip, country, email, phone, url,
username, password"
notrequired = "email, url"
So what I need to do is take email and url from the required list and make a new list. I've got a bad cold, and my brain doesn't seem to be functioning correctly. I just can't seem to make this work without either truncating the result incorrectly, or getting duplicate values.
View Replies
View Related
How can I remove a value from an array. Like: remove from array where value=bla-bla?
View Replies
View Related
is there a function i can use of some sort to remove a specific element in an array by its index number?
View Replies
View Related
I have a shopping cart script that I am trying to add a "delete" function to. The code below is taken from this project: Code:
View Replies
View Related
One of my tables is used for two purposes so there are blanks in the column I'm filtering. I tried using an IF statement but it still put the blanks in the list menu. Any idea how to remove the blank items? Code:
View Replies
View Related
I would like to create a page with VBscript and ASP which will contain
two list-boxes one in the left side and the other in the right side
with two buttons namely "Add>>" and "<<Remove" so that if the user
selects a value listed in the left side list-box and presses "Add>>"
then that selected value should go inside the right side list-box.
Similarly if the user selects a value listed in the right side
list-box and after clicking "<<Remove" then that selected value should
go back to the left side list-box.
Can anyone provide me the code?
View Replies
View Related
how would I go doing it without javascript and using 'POST'?
Having a page with a variable list of items in a shopcart, each item
with its own 'remove' button. How could I do this without a javascript
and using POST as the form type? (so having <a href="page.htm?remove=2>
is not possible)
View Replies
View Related
I have a string that was populated from a listbox. Now I want to bring up the record again for edit and want the listbox to have those records selected ONLY. I am close I think. Currently, it selects all records.
<%
HearingIssues = RS3(0)
HI = Split(HearingIssues, ",", -1, 1)
For i = 0 to ubound(HI,1)
sString = Instr(HearingIssues,HI(I))
if sString = 0 then
%>
<option value="<%= HI(I)%>"><%=HI(I) %></option>
<% else %>
<option value="<%= HI(I)%>" selected><%= HI(I) %></option>
<% end if
next
View Replies
View Related
I have managed to populate a dropdown box with a list of all files in
the current folder and even filtered them by the extension so that it
only displays the .mdb files. However, the menu seems to be holding
all of the items in the folder and displaying only the .mdb.
This
seems to be a problem with the way I am defining the size of the
array. If I add my .mdb filter to the array loop I get an 'out of
range' error for the n variable?? Can anyone suggest a solution??
Code:
View Replies
View Related
I am required to prevent duplicate posts........how can i do this?? my database is MS Access and am using ASP.
Have been scratching my head fo quite some time now........cant figure out the logic.
I understand i cant limit it from the database....if possible i'd like to know how to handle the error that it would give with a page with message
or how can i compare the entry from the database before i post it
View Replies
View Related
I have a string value which has the bellow content.
Dim aString as string
aString = "1,2,4,2,2"
where aString is a parameter set dynamically based on the user loggin into the system. Now All I want to do is to eliminate the duplicates. ( In this case I need to keep only one "2" and remove the remaining "2" , so my final string should be "1,2,4" ).
How could I do that. I was thinking of an array, but the issue is, If the "aString" is empty I believe array will return a error. So any other way of doing ?. Or simple asp functions which will eliminate this.
View Replies
View Related
A member logs on and enters a record, if one already exists for that date, then they get a message saying so. If not the record is added and some text is displayed. But it still allows me to enter records even if one already exists! is it because I am storing my dates as strings? Code:
View Replies
View Related
a way i can remove recordset rows that have identical entries in a column?
View Replies
View Related
I've got a form that allows the user to search a table for data and if it finds that the data is not there, it should insert what is missing into a new table. But I'm not sure as to how I would check the records before I insert records. Code:
View Replies
View Related
I have two very simple Access tables:
tblNewsletter
==========
ID | Email
tblSaved
==========
ID | Email
There are thousands of records in each. I need to check for duplicate email addresses across the two tables and remove them from tblSaved if they appear in tblNewsletter.
How do I go about doing this?
View Replies
View Related
I have a permission tracking app that I am working on, and I have made the insert page for it. I am having issues on how to prevent duplicates from getting entered.
Currently the interface for the app has a mixture of select boxes, list boxes and checkboxes. The form submits the page to processAIMR.asp and then does the inserting. I am using a loop to insert a new record for each checkbox checked or listbox entry selected. Code:
View Replies
View Related
How can i list out all the email address into my website from the hotmail caontact list? i am successful log in into the yahoo contact list by using serverxmlhttp and list out all the email address from the page source, but i could not access to hotmail by using the serverxmlhttp. Is any other methos can list out the email address from hotmail contact list?
View Replies
View Related
I dump the entire recordset into an array:
If not rs.EOF Then
aEmp = rs.GetRows()
Contents of the array are in this order:
EmpID,EmpName,Indent,Sub_ID,Lft,Rgt,MgrID, LastName
This query sort on the basis of Lft and Rgt columns.
The name of the array is: aEmp.
My question here is how can I get only the LastName from the aEmp array into another array so that I can sort the names alphabetically and then display the employees in the alphabetical order.
Or is there is another way I could this by using the same array while keeping the lft and rgt sort of the query? If I sort based at the SQL query level, I can see the names sorted by the lft, rgt and lastname, but since the lastname is at the end of the sort list - it does not appear alphabetically.
View Replies
View Related
In working with arrays, I have found that I am unable to dimension and array
with a variable that has an integer value but I can redimension one this
way. I haven't see any information that tells me if this is a requirement,
although it appears to be because I get an error if I try it.
Ex.
Dim b
b = 10
Dim a(b) ' this errors out but
Dim a() ' this
Redim a(b) ' works
Code:
View Replies
View Related
I found a simple date script, which is this:
<%
var_date=date() 'get the current date
var_date=FormatDateTime(var_date,1)
Response.Write(var_date)
Wednesday, September 29, 2004
How can I get this to not display the day of the week, I only want - September 29, 2004
View Replies
View Related
I found a simple date script, which is this:
<%
var_date=date() 'get the current date
var_date=FormatDateTime(var_date,1)
Response.Write(var_date)
%>
Wednesday, September 29, 2004
How can I get this to not display the day of the week, I only want - September 29, 2004.
View Replies
View Related
i have a variable which holds a value like this
stramount=Trim(Request.form("txtamount"))
response.write stramount
the output sometimes is
50.00 or
50 or
50.
if it is 50.
i want to remove the (dot) at the end. can someone tell me how to use the instr function to see if there is a dot at end and if it is there then remove it.
View Replies
View Related
i have problem in removing the gap between two images, pls see the attached image. coz my item name is quite long, i dun wnat it display in horizontal, i want it display as vertical. so i create the images for the character and use ascii to recognized it.
my code is as below:
<td align="left" class="BorderLeft" width="1%">
<%dim word, pic, word1
word = "AAAAABABABBA"
pic = ""
for i = 0 to len(word)-1
word1 = cstr(right(left(word,len(word)-i),1))
pic = asc(word1) & ".gif"%>
<img src="../images/<%=pic%>" border=1 vspace=0 hspace=0>
<%next%>
</td>
View Replies
View Related
How can I remove a cookie from the client in ASP? I'm not talking about setting the value to a blank string and I've tried this:
[vbs]
Response.Cookies("mycookie").Expires = Now()
[/vbs]
and
[vbs]
Response.Cookies("mycookie").Expires = Date() - 100
[/vbs]
Neither of which work.
Is there any way to completley remove the cookie?
View Replies
View Related