Remove Commas And Space
let say i got a string:
apple, orange, durian
how to check got how many commas in this string? how to check beside the commas is space or not space? if the words beside the commas is space, i wan to remove the space? if the words got commas, i have to remove the space.
View Replies
ADVERTISEMENT
Using ASP/VB I need to remove unwanted commas from the end of a field
that will be use in an array. There are items in the field that are
comma separated, so I don't want to remove them, just the end ones,
could be anywhere up to 5 unwanted commas.
Any ideas?
View Replies
View Related
I'm importing data from a csv file but have the following problem.
It see any comma in a specific column as the end of the current column and move the rest of the values into the next column I.E Data from column 4 display as data from column 5.
I do know that it's comma delimited but would like to know if there's no way that I can distinguish between the commas in a column and the commas that indicate a new column.
Col1 Col2 Col3 Col4 Col5
Value Value Value Val,ue Value
How do they do it in excel?
View Replies
View Related
I'm dynamically building an SQL string to do an execute, and keep ending up with a leftover comma, so the string looks like this.
INSERT INTO Software ( Title, Version, Licensing, Total_Licenses, support_phone, support_email, Campuses_Licensed, Comments, support_web, FundingSource, Course_title, Subject, Grade_level, LocalExpert, ACTIVE, CATE, EntryDate,) VALUES ( 'Bob's Super Crappy Software', '4.3', 'labpack', '36', '555', '555', 'Alexander, Bilhartz, Central, Fairmeadows, Hyman, Daniel', 'James is testing this', 'www.bob.com', 'Campus PO', 'Math', 'Math', '4, 5, 6', 'Patrick Williams', '1', '0',)
Both commas are added dynamically and can be trimmed on the fly. I tried using RTRIM(strSQL, ",") but this didn't work.I put the fields into an array and tried to add only commas to all but the last entry, but that also didn't work.
View Replies
View Related
How is the best way to handle commas in data in CSV files? I'm currently using the following:
set fso = createobject("scripting.filesystemobject")
set act = fso.opentextfile(server.mappath("filename.csv"))
itext = act.readall
arrlist = split(itext,chr(10))
and then looping through the rows and splitting at commas. However, some of the data has commas in it, which is throwing things off.
View Replies
View Related
4 months into the land of ASP and I still have newb questions.I have a simple string.
centertype = Type1 & Type2 & Type3 & Type4 & Type5
How do I add a comma to seperate this string? Keep in mind that some of the values may be blank.
i.e. Type1 = ""
or Type4 = ""
View Replies
View Related
I need to create a string along the lines of "23,43,78,23" with no comma at the beginning or end of it. The data comes out of a table so i've created a loop to get the data and form the string :
StrRecip = "," & objRS("number") & StrRecip
This will give me something like : ",42,78,67,2,90"
And then I've removed the leading comma :
StrRecipRem = replace(StrRecip, ",", "", 1, 1)
Is there actually a better way ?
View Replies
View Related
I don't know if anyone has encountered this before. I've written ASP code to insert, update and delete records from Access and SQL Server tables before but this is the first time I face this issue -
I have a form that inserts data into an Access table. For a few of the fields, commas are getting inserted into the table. If the field is left blank, there is a comma inserted. If we enter data in the field, the comma is appended to the field value (eg: smith, )
The only thing different that i'm doing here from what I've done before is I'm inserting a larger number of fields into the table - 117 fields!!
Do you think the insert statement hasn't been written correctly?
View Replies
View Related
I have a price field in a cms,it can deal with full stops fine, but i cant understand why it wont accept commas.
View Replies
View Related
I would like to know if you can display only certain data into a field between commas or any other symbol without using the curshort feature. For example. I have the following.
Part, A3472, Desc: Controller: Price$ 45.00
I just need this out of it in a single form field.
A3472
I cannot use the cutshort feature because my part numbers are different lengths.
View Replies
View Related
having problems removing commas from my form input. Have a form that is bringing back text strings from users. when it gets put into CSV file, any commas the user has entered get moved onto new rows.
View Replies
View Related
I have a simple script I found that increments a number in a text file. I was wondering if anyone has a routine that will commify the number. Code:
View Replies
View Related
how to avoid an error when calling data to a text form field that contains inverted commas? When I enter "inverted commas" into a text field on a form and save to my Access database, after save the text field appears to be blank but when I look in the database it appears as entered. The problem is when the text field calls the field it doesn't show if the text is encased in inverted commas.
For instance, in my form field 'title' I enter: Big Title "Yeah" After saving the form, all that appears within the form field 'title' is: Big Title Yet the access database itself shows: Big Title "Yeah"
View Replies
View Related
I would like to know if you can display only certain data into a field between commas or any other symbol without using the curshort feature. Code:
View Replies
View Related
I have a string --> 7,8,9,10. This string may contain more or less than 4 numbers.
I want to separate each number and run an sql query for each number.
for example:
select * from table1 where code = '7'
select * from table1 where code ='8'
and etc....
Can I do this in a loop?
View Replies
View Related
how do i count the number of values sent accross the form post seperated by commas ?
e..g 43352352,325324452,235234452,24523454
View Replies
View Related
i have a form where a user will enter their information.... i know how to check if the user didn't enter a value so that they are not redirected to the next page but how to check if the user pressed space and not allow that space character to be a valid character?
View Replies
View Related
I have a webpage with some hyperlink within a button. The problem is that some of my hyperlink is shorter that others and therefore the user must navigate to the hyperlink to click on the link
The thing I want is to make the button more user-friendly user can click anywhere on the button and not only on the hyperlink within the button
Here is my code ....
View Replies
View Related
In an ASP Page is there a way to have a link that calls another page whose name includes a space? For example, I'd like to be able to call "My Page.asp" by building a href type link the user can click on. The equivalent of:
<a href="My Page.asp"> Open </a> the page
I've tried URLEncode but that didn't work.
View Replies
View Related
I’m reading a list of values from a database table a creating a dropdown list on a web page. These are used as search criteria to search on a second table. The user selects and item from a list and then clicks a button to submit the search. All of that works.
Most search words in the list are a single word with no spaces. Some are two words. When that is passed, anything passed second space gets lopped off. Here is the line of code that creates the dropdown box
sDataSet = rs1("Dataset")
response.write "<OPTION selected value=" & sDataSet & ">" & sDataSet
I tried this, but it didn’t work
response.write "<OPTION selected value=" & Replace(sDataSet, “ “, “%20”) & ">" & sDataSet
It replaced the space with %20, and the entire search phrase was passed, but the search failed because the %20 was not converted to a space on the other end. So now I doing the conversion myself after I do the Request.Form. Is there a better way though, to deal with spaces.
View Replies
View Related
My form gets populated from an access database. Now in the database there are fields containg <br>. While in a normal page everything works as it's supposed to, in my listbox the <br> shows as it is. What I would like to do is replace it with a space so I've used this:
<option value="<%=(rsProducts.Fields.Item("CatNum").Value)%>"><%=replace(rsProducts.Fi elds.Item("NotesR").Value),"<BR>"," "%></option>
but it doesn't seem to work.
What exactly am I doing wrong here?
View Replies
View Related
i need to combine 2 vriables that are retrieved from a form. idate and
itime.i want to put these into the t_date field in my sql db. but for it to work
properly, there needs to be a space between the idate and itime.
how do i do this?
i know i should know this, and i have used it before. but it has been so
long, that i can't remember for the life of me.
View Replies
View Related
1. dopage.asp?<% =SessionID=value_here%> is different tha
2. dopage.asp?<%=SessionID=value_here%> ??
Please note that there is a space between the asp tags and the = sign in the first item. I thought ASP will treat #1 and #2 as the same. However it seems that is not the case.
View Replies
View Related
can anyone fix the space problem in my sql statement? I am getting this error message:
ADODB.Recordset (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
This is my sql statement:
sql = "SELECT * FROM " & tblname & " WHERE " &Col& " = N'" &Var& "' AND [Show]=1 ORDER BY [Code] ASC"
And I am passing the parameters to the url something like this:
Product.asp?Visit=Yes&Var=Hong%20-%20Kong&Col=Place
Problem is that most of my data contain a space (eg. Hong Kong).
I don't have this error when my data is single word (eg. Sydney)
View Replies
View Related
I want to check the disk drive space on a small intranet. Like 30 computers. All have been partitioned and have a D: drive that is shared and is the drive I'm trying to check. This is basically what I have tried:
Code:
Dim fs, pcdrive, cdrive, n
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set pcdrive = fs.GetDrive("xx.xx.xx.xxshare01-d")
Response.Write("Share01 Free Drive Space is: " & pcdrive & "<br>")
set pcdrive = nothing
set fs = nothing
Is there something wrong with the code or would it possibly have to do with permissions? When this script runs,I get a page cannot be displayed.
View Replies
View Related
when it writes the varFault option to SQL, there is lots of whitespace written too!I have tried the Trim option but to no joy
<%@LANGUAGE="VBSCRIPT" %>
<%OPTION EXPLICIT
Dim objConn, strSQL, objRS, varName, VarExt, VarFault, varDept, strSQL1, objRS1
Set objConn = Server.Createobject("ADODB.Connection")
objConn.open Application("helpdesk")
varName = Request.Form("name")
varDept = Request.Form("departments")
varFault = Request.Form("txtFault")
strSQL = "INSERT INTO new_calls (Name, Department, Fault) VALUES "
strSQL = strSQL & "( '" & varName & "','" & varDept & "','" & varFault & "')"
strSQL1 = "SELECT * FROM new_calls "
strSQl1 = strSQL1 & "WHERE call_id= '"'
set objRS = objConn.Execute(strSQL)
%>
View Replies
View Related
Say I have a 'Mc Paul' in the database, what would i need to do if the user searched for 'McPaul' how could i pull that record out of the DB.
View Replies
View Related
I'd like to know how can I make the first letter of every word on a textbox field, uppercase, automatically. I'd like to use this for the Name and Surname field, but I don't know how?
View Replies
View Related
Now that my website is compleate(ish), I am looking for server space(for free) to host it on. A lot of the ones I have seen, for some reason, do not support classic ASP.
View Replies
View Related
Sometimes I am getting the errormessage "Out of string space ". The error occurs on this code:
sBrf = sBrf & sBodyTmp & "par page par "
When this occurs len(sBrf)<100.000 and len(sBodyTmp)<10.000. Also there is about 1,5gb fysical memory free. I am using Windows 2000 IIS5. I tried isolating the proces in IIS to make sure no other scripts are involved, but it doesn't help.
View Replies
View Related
If I try to retrieve a char field from MySQL with 11111111
in the field I have no problem, however if I put in: 11111 111111
then it doesn't retrieve the part after the spaces it seems to just chop it at the first space. Can anyone help my with the code to make it work.
View Replies
View Related
where i can find a myspace clone?
View Replies
View Related
I trying to find the memory occupied by the object in RAM, For Example:
Set ObjTest = Server.CreateObject("ADODB.RecordSet")
I need the space occupied by the ObjTest in RAM. Is it possible ?
View Replies
View Related