I have an HTML newsletter, which also has a txt only version. I am looking for some way of parsing out the links from the HTML version using an ASP function, and including them in the text only version. So instead of: visit this great site, you'd get something like: Visit this great site (www.codeproject.com) Unfortunately, I only have WSH 5.0 - so no regular expressions that I've tried seem to work. Any ideas?
Garth
Posts
-
ASP - extract links -
TRICKY - How to SELECT TOP X records when using UNION?I have the following query: (SELECT P_Title AS Title FROM tblProjects WHERE Status='True') UNION ALL (SELECT Title FROM tblProjectDocs WHERE Status='True') UNION ALL (SELECT Title FROM tblLinks WHERE Status='True') ORDER BY Title DESC This returns roughly 26 or so records. I want to include only the top 6 or so records. Using SELECT TOP 3...etc does not work correctly - as for some reason, this means records are displayed in an odd order, and more than 6 records are returned in total. I have tried mucking about with the position of brackets, doesn't seem to work. Elsewhere it is suggested that a sub-query might work (e.g. SELECT TOP 6 FROM (query with UNION) ORDER BY Field). This doesn't work either. Any ideas?
-
retrieve column lengthIs there a quick way of running an SQL query that will provide the maximum length of data that can go in a particular column? I created a table, and want to be able to limit text input so that the maximum field length is not exceeded
-
Problem with SQLserver and updating recordsetI am trying to update an existing record in a table using the following code in an ASP page. The table (tblProjectCats) has an ID value (integer, autoincrement), and Title and Description fields (both set to varchar). The following code just doesn't work...doesn't give an error message... '//start code Dim objConn, objRS Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open strConnect Set objRS = Server.CreateObject("ADODB.Recordset") objRS.Open "UPDATE tblProjectCats SET Title ='Title', Description = 'Desc' WHERE ID=1", objConn, adOpenDynamic, adLockReadOnly, adCmdText objRS.Close Set objRS = Nothing objConn.Close Set objConn = Nothing '//end code
-
replace web address with text friendly textI am looking for a way of removing instances of a web address/URL from an amount of text, where the URL is in the format Site Description and replacing/reformatting the text (for a text only newsletter) into a form like Site Description - www.something.com I am running WSH 5.0 - so some advanced regular expression features are out....any other ideas on how this could be achieved??
-
break up line length after N charactersI have a web page where I have text files (some with HTML commands included) that are loaded into a page using FSO. I can't get the text to wrap properly when it is loaded into a table - it just keeps extending across the page, pulling the whole layout out of whack. I have no idea why this happens, as the text theoretically should just wrap within the table. What I am wondering is if anyone knows a way to go through the text file, and once say 80 characters has been exceeded, replace the next available space between words with a line break? and then keep going through all the text until each line is roughly 80 characters or so long. (I just don't want to end up cutting up any HTML commands) e.g. I wouldn't want to end up with Y>. Of course, if you had any lo-tech ideas as to fixing up the display of a text file read into a table, then that'd be just as good...
-
SQL and ASP variables (a.k.a this is driving me insane)I am using this statement to return some records. The statement using the ASP variable ActiveID to pull records according to categories. This works fine, but I can't seem to add further variables (e.g. How would I add an ORDER BY statement to this?) RS1.Open "SELECT * FROM Table WHERE Cat_ID =" & ActiveID, DB1, adopenstatic What I really want to do is return records updated in the last seven days or so. I have the last modified value stored in a table in the format DD/MM/YY -- is it possible to do a SQL query that will only return records updated in the past seven days?
-
How to delete multiple files using FSO and wildcards...I am trying to use the file system object to delete a batch of files, based on the name of the file. E.g. I have files in the format: file17_68.asp The first number signifies a category, the second is an individual ID. What I want to be able to do is delete files that belong to the one category. What I've tried is: *start code snippet* set fso = Server.Createobject("Scripting.FileSystemObject") fname = "\files\file" & EditCatID & "*.asp" fso.DeleteFile(Server.MapPath(fname)) set fso = nothing **end code snippet** I thought the wildcard (*) would mean that all files beginning file17 would then be successfully deleted. This fails to work - so does anyone have any brilliant and cunning ideas? or suggestions why this doesn't work?