Replace :: Commas

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


ADVERTISEMENT

Replace Function Not Replacing What I Tell It To Replace

If I replace "a" with "b", and then I replace "b" with "a", shouldn't I get the same result? That is what I am trying to encode and decode with Replace() function, but it is giving me different things when I replace and replace again. Here is what I am talking about: Code:

View Replies View Related

Trimming Commas

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

CSV Commas In Data

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

Adding Commas

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

Remove Commas From End Of String

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

Import From Csv - Remove Commas

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

Commas Getting Inserted Into Database

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

Commas Not Full Stops

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

Display Data Between Commas

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

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 View Related

Removing Commas From Csv File

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

Adding Commas To A Page Counter

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

Inverted Commas Hides Data

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

Display Data Between Commas In Form ASP

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

String With Commas, How To Use Instr And Mid Function In A Loop?

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 Values Seperated By Commas

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

Including Inverted Commas To Specify Page Elements While Page Is In ASP

I am having a problem with a site that I am developing - my aim is for it to validate as XHTML Strict however, I am running into a couple of problems validating it; in my Response.Write ASP script, I am not including " 's to define page element tags as they keep throwing up errors in the page. Code:

View Replies View Related

Replace Url

some text is coming out of the DB with different urls in it, i want to delink it (like href="#" or something), how do i do that when i don't know what url is coming out?

View Replies View Related

Replace()

I've got a function that I use to replace ' marks so the page will insert properly into a database - typically I use .Code:

whatever= request.form("whatever")
whatever = replace(whatever,"'", "''")
However, I've got some code that I unfortunately inherited from someone else that I can't get the replace to work:Code:

call buildquery (colq,valq,retq,"whatever")
colq = "(" & colq & ")"
valq = "(" & valq & ")"
ssql = "insert into table_name " & colq & " values " & valq
I was trying to do something in the call buildquery line to add a replace, but that doesn't seem to work.

View Replies View Related

VB Replace

How do I take out double quotes before writing to database? As doing ,""","&quote;" created an error.Is it something like ,chr(34),"&quote;" which I sort of stumbled accross when I did soem google searching... But what and where do these chr(34) etc coem from?

View Replies View Related

Replace Tab Key

I have lots of textbox that needs to have data entry. Is it possible for me to replace the tab key to return key that transfers the focus from one textbox to another? And also, how to submit the form after all textbox have values?

View Replies View Related

Using Replace

I come across this often

PHP Code:

Replace(rs.fields("Headline_f"),"''","'") 

Where rs.fields("Headline_f") is actually empty.

I usually use

PHP Code:

IF NOT isNull(rs.fields("Headline_f")) or rs.fields("Headline_f") = "" THEN
  Headline_f=Replace(rs.fields("Headline_f"),"''","'")
END IF 

Is there a better way to handle this?

View Replies View Related

Yet Another Replace

Even though I ask customers to enter there phone number like xxx-xxx-xxxx they some times don't. go figure:

I create a text file thats used by the factories EDI system and the number needs to be xxxxxxxxxx. I'm using the code below but what if they enter their number xxx.xxx.xxxx OR (xxx) xxx-xxxx etc. You get the idea.

strPhone = Replace(objRS("DayTimePhoneNbr"),"-","")

Does some one have a small chunk of code to help me replace additional chars?

View Replies View Related

Replace <br> With Space

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

ASP Replace Function

I've tried EVERY way i can think of to do this replace function, basically when i go to insert "Do's and Dont's into the database it cuts it off at "Do" because of the ' now ill show you my section of code that i have it in currently:

curdescription = trim(replace(arrTemp(4), "'", "''"))

I have it this way and it doesnt work, and i even had it

curdescription = trim(arrTemp(4))
curdescription = replace(curdescription, "'", "''")

View Replies View Related

Replace Blankspace With %

i use the URLencode function and it changes my form text to: this+is+it%21

ok, this is good, but when I use it in a URL, it includes "this" but then the link dies and the rest is just text, the user must then copy and paste the whole address in the browser. Anyway to get around this?

View Replies View Related

Replace Error

what's wrong with this string?

" WHERE InStr (" & request("Field") & ", " & chr(34) & replace(replace(request("SearchWord"),"*","%"), "'", "''") & chr(34) & ") > 0 " & _

View Replies View Related

Replace " And '

i have some sql data that has " and ' in it. can someone tell me how to do a replace on those so they display correctly?

View Replies View Related

Find And Replace

I am not sure if this is a question for this forum or the IIS forum but here goes. I have a dedicated server on which I am hosting about 80 websites at the moment, all of which have been created by copying a template site. All of these sites have an identical structure and are located in the same directory on the server, C:Inetpubvhosts. Several times when I have needed to make an adjustment to the sites I have to go into the remote desktop connection to the server and go site by site, copying and pasting files. For example, as each site has the same pages, ie., map.asp, sometimes I make a change to that page and have to copy it to every site. Could I write some sort of script using the FSO and execute it from one site and have it loop through each site on the server making the neccessary change(s)?

View Replies View Related

<p> Replace HTML

Does anyone have a snippet that will replace ALL HTML formatting BUT
leave the <p>'s and <br>'s ??

View Replies View Related

Replace Not Working

my replace is not working
Shipping News ...i don't want news word ..mean i just want
Shipping
Code:

<%=Replace(rs("name"), "news", "")%>

View Replies View Related

Null: 'replace'

Can someone help with an error? It's a StoreFront store. right after the credit card screen is gives me the error. I get the following:

Microsoft VBScript runtime error '800a005e'

Invalid use of Null: 'replace' /ssl/SFLib/incGeneral.asp, line 85

--------------------------------------------
84 Function makeInputSafe(str)
85 makeInputSafe=replace(str, "'", "''")
86 End Function
-------------------------------------------

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved