Take A Paragraph Out Of String

I don't know Regular Expressions At All And I Could Really Use Your Help.
Is there a way to extract the paragraphs out of a string?

View Replies


ADVERTISEMENT

Striping HTML Tags From String, But Leaving Paragraph Formatting

I have a string of HTML (used for a specific purpose) that I'd like to
use somewhere else but as plain text. Rather than introduce a
specifically created plain text version I'd like to strip the tags code
from the HTML version. This in itself is easy, using a function such
as:

Function HTMLDecode(Expression)
Dim sTemp
sTemp = Expression
sTemp = Replace(sTemp, ">", ">", , , 1)
sTemp = Replace(sTemp, "&lt;", "<", , , 1)
'Repeat for each defined entity
HTMLDecode = sTemp
End Function

However, the difficulty comes when trying keep each paragraph seperate.
For example, the string "this is<p>my name" shows on screen as:

this is

my name

if I use the above function, it strips out the <p> tag and shows the
result on one line:

this is my name

I thought I could use something like:

str = replace(str, "<p>", chr(10))

but that doesn't seem to work. Can anyone help me replace <br> and <p>
tags with something that's recognised as "plain" text but will keep the
paragraphs and new lines formatted correctly??

View Replies View Related

Format Paragraph

I've had some excellent help before on this forum and hoping for some more.
This is probably very basicbut I'm kind of muddling along a bit and it's a miracle I got so far.I have a memo text field in a table form and I'm wanting to enter text into it but all a small amount of formatting. Just basic paragraph breaks would be a start. This is kind of following on from a previous post of mine where I was trying to include line breaks. This was the solution.

Code:
<textarea name=whatever WRAP="HARD">

View Replies View Related

Paragraph Using CDONT

I am trying to send an email with the values from a form. I want to send the text field values as paragraphs on the email. It comes as one paragraph and there is no break.

View Replies View Related

Paragraph/<br> Tag In TEXTAREA

I am using TEXTAREA as input. While entering texts sometimes I am creating paragraph and save them .But when I retrieve from database it comes without paragraph.

Is there any way we can create paragraph in TEXTAREA?

View Replies View Related

Paragraph Finder

I have a query about ASP with Javascript, I am trying to automate a form whereby when you type in some text in a form and hit the return key on your keyboard the asp/javascript places a <p> html marker in that paragraph space so when you hit the submit button the text is display correctly, i.e. the paragraphs are displayed and the text does not come out in one block. I have created a very simple form and button using ASP/VbScript and it works. For some reason I cannot work out how to do this with ASP/Javascript. This is so when in future all text is sent to a database we do not have to input the <p> markers manually. Obviously there is more to this, like connecting to a database to drag the text off first, but the code I have created is merely for testing purposes first.

here is my ASP/VBScript code below: ...

View Replies View Related

Extracting The First Paragraph

Is it possible to extract the first paragraph in a mysql text field? my code line to display all text:

<%=replace(Recordset.Fields.Item("article").Value, vbcrlf, "<p>")%>

I want to separate the 1st paragraph (article lead) from the others (article), without having one table for 1st paragraph and a second one for the rest of the text.

View Replies View Related

Paragraph Breaks In Forms

I am building a small CMS for my son's school. Ideally I want to build the system for them and hand it over so that all updates can be done through web-based forms.

So far so good. However I'm having a problem with fields designed to take multi-paragraph stories or articles. I'm using a text area field on the form which saves the data in a memo field in the database. Teachers would typically cut and paste stories from word documents into the text area field.

However when the data is loaded back into the website from the database all the carriage returns have been removed and the story consists of one long paragraph.

View Replies View Related

Textarea Paragraph Breaks

I have a form with a textarea input. The form then stores the text in a database. I want that text to be written to a web page (not a textarea).

Well if I don't put a <p> in between paragraphs, of course the paragraph breaks don't show up on the web page. How can I make it, so when I hit return in the text area, a paragraph break shows up in the asp page?

View Replies View Related

How To Extract Email Ids From A Text Paragraph

I ve a text paragraph something like

sample sample sample sample Join Bytes! <ee@ss.comsample sample
sample sample sample sample sample sample sample sample
Join Bytes! sample sample sample <ww@example.comsample sample
sample sample sampl Join Bytes!


i want to extract email ids from the above text paragraph.. using
Active server pages or php can u give me some clue to find a
solution.

i ve tried some regular expression technique to sort out this problem
but.i cant get the proper output

View Replies View Related

Problem Stripping Paragraph Tags

I have an asp page that reads the contents of a database and creates an xml news feed. I have code that strips out the <BR> and <P></P> tags, but it looks one of the databases I'm trying to read from uses only <P> without the closing tag.

So the make a long story short, I can't figure out what to add to my code to strip out these tags (or if that isn't the problem at all!) Code:

View Replies View Related

Response.Write Into Paragraph Form?

I have a scrolling text box where people input a list of information, using the <ENTER> key between lines.

The submit button transfers this information into the Access DB into a memo field.

When I try and pull up the information using Response.Write, all of the line breaks are gone, its just moshed together.

What better way is there to do this so my line breaks are intact?

View Replies View Related

"simple" Paragraph Formatting

I have the below mentioned code that I am using to send a simple html email via ASP. Please do let me know how I could modify the code so that the carriage returns are captured and the paragraphs that are entered within the text area are preserved. I do not need any fancy hmtl formatting - just the paragraphs. Code:

View Replies View Related

Web Forms / HTTP File Upload / String.Split A StreamReader.ReadLine() String

I'm developing an Asp.NET system to take a CSV file uploaded via the web, parse it, and insert the values into an SQL database. My sticking point comes when I try to split() the string returned by readline() on the file.

The following code snippet works for me:
tokens = "one,two,three,four".Split(",")
for each token in tokens
response.write("<td>"+token+"</td>")
next

However, if I take the next line in the CSV, read using StreamReader.ReadLine on the PostedFile.InputStream, I receive "Object reference not set to an instance of an object." which I have narrowed down to be my string holding the line. Further investigation reveals that no other string member functions work on my line (.ToCharArray, .ToString, etc).

I suspect that StreamReader.ReadLine is not correctly returning a string, even though Response.Write(line) displays what I would expect .....

View Replies View Related

String Functions Run On Empty String

I have a form in which several elements are expected to be all digits. Some of those elements can be left empty, but if specified they must be all digits. I have this Sub to edit them: ....

View Replies View Related

Text String To A Interger String

I am pulling info from a sql server By default the query pulls back the inforamtion as text.Therefore when I go to calculate some figures its giving me a type mismatch error.
Is there a function in can call to convert a text string to an integer string using

rstSearch.Fields("name").Value .To pull back the info in a for loop

Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch

View Replies View Related

String Contains ?

If a visitor doesn't put anything in the "Search" text box I'd like them to
be redirected to where they came from before the search form forwarded them
to the search.asp page. Therefore I've put the following at the top of
search.asp to do this.

View Replies View Related

ADO LIKE 'string'

I am trying to search my access database for a string using LIKE and a wildcard.
Example:

Code:

Dim con

con = "SELECT names.* WHERE name LIKE 'sam*'"

For some reason this gives me no results even though I verified there is entries with the word sam in them.

Also tried using % instead of *. Also took out wildcard. I can search for an integer without a problem though, when I try a string, regardless if there's relevant entries I get nothing back at all.

View Replies View Related

SQL String

I am using an SQL statment with a LIKE clause. I am trying to print the actual SQL statement on the screen. However I cannot print a '%' character on the screen. I tried using Chr code and just % outright.

Random variables:
name, rank

Code:

sSQL = "SELECT * from myTable WHERE myField LIKE '" & name & "%'"


It just prints on the screen: (assume name=joe)

"SELECT * FROM myTable WHERE myField LIKE 'joe'"

View Replies View Related

String To Int

i have an object which is a string, (objrs4("points")) how do i convert it into int numbers.

View Replies View Related

String Value

i need requirement for the current assignment Im working on.Part of my assignment I have to saved updated data from a datagrid and put into database. I had everything working, but without option strict and explicit. When I put it on i'm having trouble getting the value out of it.

What I need is to get the value out of the textbox control of a datagrid in edit mode. The value is supposed to be in Item.cells(2).Controls(0) but I have no clue on how to get it out correctly. Ive tried everything but keep getting errors that it cannot be converted to a string.

View Replies View Related

Getting Url From String

the subject that i need to filter the URL from a memo field that having lots of URL in it, like when we post a message with URL www.websourceinfo.com it will become a base url link with click

View Replies View Related

String Contain

I searched google for this (probably easy to solve) problem, but all answerd there did not work hop someone can help me out.In an asp I want to check whether a string contains a " if so the response should be that the "-sign is not allowed.

Elseif InStr(1, username, """) > 0 then Response.Write "-sign is not allowed in the username."

Tried char(34) and /" and """ but none of these options seem to work.

View Replies View Related

Cut Something From A String

I guess this is easy, but I ask anyway.How can I cut 'www.' and '.no' or '.com' from a string?

example input:

www.norway.no
www.somewhere.com

I want this output:

norway
somewhere

How can I do this?

View Replies View Related

String Within Other String

splitted from this thread, I need to dosomething similar i need comare 2 variables. one of them conaints the other variable but have more information

i need compare
a= "red car"
b= "red"

and then i need ask if is b in A then c=b but i dont know how.

View Replies View Related

Hex To String

converting string to hex like so:

for x = 1 to len(source)
target = target & hex(ascw(mid(source,x,1)))
next

How to convert it back to a string?

I got as far as:

for x = 1 to len(source) step 2
target = target & chr("&H" & mid(source,x,2))
next

but this fails with the pound sign (£ - &pound;)

View Replies View Related

Len(string)

This seems like it should be so simple. I would like to create a conditional statement based on the length of a string. The string is a memo field from an Access database. I would like to handle long memos differently from short ones. I'm starting out just by trying to write out the length of the string:

memo = RS("Idea_Note")
Response.Write Len(memo)

I can response.write the memo without trouble, but I get nothing for the length of the memo.

View Replies View Related

String

I have a drop down list of ssn and text box to input ssn to view the info in the next page. I am having a problem with displaying and when I debugged the code, I am getting a comma next to the ssn. Here is my code the dropdown and input type:ssn is text field. Code:

<table>
<tr>
<td>
<Select name=ssn >
<%response.write("<option value=""" & RS("ssn") & """>" & RS("ssn") & "</option>" & vbcrlf)%></td>
<td><input type=text name=ssn value="">
</tr>
</table>

In next page when I response.write ssn, I am getting the ssn as: 123456789, why am I getting a comma next to the ssn?

View Replies View Related

DB String

I got this huge query string that works well if I put something like this:

"select * from table"

in the table, there is a field called result wich is a varchar

so if I write "select * from table where result=" & result it says:

Microsoft OLE DB Provider for SQL Server error '80040e07'
Conversion failed when converting the varchar value 'E' to data type int.

/backoffice/ac_medica/operadores.asp, line 82

I'm gonna need the same for dates later... Can anyone tell me how?

View Replies View Related

Breaking Up A String

I am wondering if any body can guide me on how to break up a string so that i can use the first letter as a querystring.

View Replies View Related

Can't Get Connection String

I need to create some .asp pages to publish data from our manufacturing lines...but I can't figure out how to establish the connection string and print the data. I've been stuck on this all day and about to start pulling my hair out!!!

As an example, can someone create the most basic code necessary to build a web page that does the following:

a) connect to a SQL version of the Northwind db (assume I have a functioning ODBC connection called 'Northwind_ODBC' on a server called 'ProductionServer')

b) Loop through the records in the [Shippers] table and paste the values in a HTML table (using SELECT * FROM SHIPPERS)

I know it sounds simple but I'm looking through some books and can't find a solution that works on my server.

NOTE: I'm running Server 2003 (with IIS), SQL Server 2000, and I have proven ASP does work on this machine...unfortunately, just not with the code I'm trying to build!!!

View Replies View Related

Creating A String

Im trying to create a string from checkboxes that have been checked, but for some reason its not working

strNumbers = ""
for each key in request.form("chkFacility")
strNumbers = strNumbers + "" & key & ","
intCount = intcount + 1
next

So I want to end up with a string like this '3,12,7.' Instead Im just getting a single number. Am I doing this the right way. Any help wud be just fantastic!!

View Replies View Related

Search String

I am passing the following variables....

City - name of city
RentLow - low range of rent
RentHigh - high range of rent
myquery - keywords

The following is the start of my query string but I am having issues with the City portion already and I have not gotten to the rent yet

I know the SQLquery portion right below is fine - it tested perfectly, along with the rest of the query, it was when I added in the request city string that gives me No value given for one or more required parameters. even though one is passed in the string.

SQLquery = "(" &parsethis(strText ,words ,wCount, 3) & ")"
SQLquery = Replace(SQLquery, "<FIELD1>", "title")
SQLquery = Replace(SQLquery, "<FIELD2>", "description")
SQLquery = Replace(SQLquery, "<FIELD3>", "comments")
SQLstr = "SELECT * FROM links WHERE " & SQLquery & " AND city = " & Request.QueryString("city") & " AND linktype = 2 AND active = " & myTrue & " " & SortSQL & ";"
end if

View Replies View Related







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