Contents From A Text File Stored In One Variable
I'm attempting to read from a text file and output the contents into one variable that I can write to the page later. I can't Response.Write the thing because of the way our system is designed. Here's the code I got so far:
<%
set objFSO =server.createobject("scripting.filesystemObject")
path = "E:******************" & session("ENTRYPAGE") & "content.asp"
path = replace(path,"www.","")
set objstream = objFSO.opentextfile(path)
do while not objstream.atendofStream
lineText = objstream.readline
lineText = lineText & lineText
loop
response.write linetext
objstream.close
%>
All I get for output is the last line of the text file twice.
Note: The content.asp that I'm trying to load in does not contain any ASP. All of the content is HTML.
View Replies
ADVERTISEMENT
I was looking for a method to store the contents of text file within a variable. So far I am able to read the text file and output the results using the write method. Going a step further I also wanted to replace a particular string within those same results using the "Replace" function. This works as well.
My question, how can I store the final result that write's to the screen so that I can reference it later. If you run this code, I basically want to take the verbiage that displays on the sreen and place it into a variable. Code:
View Replies
View Related
how would i just do something like.
<%=something.txt%>
and have it display the contents of the text file?
View Replies
View Related
I tried to read a text file from my local com, but it keep on loading and loading, after tat, i'll need to restart my IIS... im sure tat the directory of the txt file is correct... The code is running very well in another com, is there any kind of permission/ something i missed?
View Replies
View Related
this is an asp/ javascript question.Say I have a variable in asp.
dim myVariable = "hello big boy"
How can I get JavaScript to read the contents of that variable?can I use it straight away?
<script language="javascript">
document.write(myVariable);
</script>
Or is it more complicated than that?
View Replies
View Related
I would like to read the dynamic contents of an asp page and set these in a variable.
In php I can do it with the help of include, but include is not exactly the same in asp.
Any clue?
View Replies
View Related
im wondering if there is a method/command which can be used so that when an asp page is called, it can 'explode' content from a text file (.txt) onto a web page, thus enabling a n00b to alter the text within the file, rather than the web page itself?
Further more, if I wanted to incorporate the text which is exploded into a CSS to give it some style flava, how would I do this? Is it possible?
View Replies
View Related
Is it possible to print the contents of a file located on the server. This file is a txt file and must be printed without the header and the footer.
View Replies
View Related
I have a text file where each record has two fields, name and number, separated by a delimiter. I would like to sort the file contents by the second filed, number, and display to browser. I can do this in php readily, but not seeing how to do it in asp. Can it be done?
View Replies
View Related
I have a stored procedure that takes parameter @description with datatype set to text.
In my ASP I have the following:
..Parameters.Append
..CreateParameter("@description",adVarChar,adParamInput,255,varDesc))
I've seen other examples of SPs with adVarChar set to 1000 and up! Is this the way it should be done or is there a matching parameter type I should be using?
View Replies
View Related
I have created a intranet site for a small department in the company i work for. Thanks to the help of these forums I have dabbled into a small bit of asp to automate a few manual processes.
One of the problems I would like to overcome if at all possible is as follows.. There is a network drive for which all the department have read access, the drive is full of useful documentation on processes and how too do things!
The major problem is that there are soo many documennts and different directories tat it would be a nightmare to try and search for what you want.... so this leads me to my question...
Is it possible to have some sort of google type relavence search that not only examines the filenames but also the contents of the files... (the files are mostly excel and word docs).
View Replies
View Related
I'd like to process an ASP page and pipe it's contents out to a file.
I can do this easily in PHP by using the php executable on the command line through a cron job(unix). Is there an equivalent for ASP? I see it as a less complicated cache.
So far I've only been able to output the actual script lines to a file. I want ASP to intrepret, then output.
View Replies
View Related
I am using a system to send mail and I want to use a variable and a portion of text together, so i am trying to do something like that:
objMail.Subject=[ text1 variablevalue ] - text2
the bold part is a variable value... i just bold it to show better what i am trying to tell... the subject donīt need to be in bold.
View Replies
View Related
Anyone know how to read excel file with ASP and stored it in database?
View Replies
View Related
I have a DB table, which contains the name of a image file stored in a folder. What i need to do is somehow retreive this image and display it in an asp page?
View Replies
View Related
I'm trying to change the colour of the session("name") variable below, but not having any luck. I need the name to be a different colour than the "logged in as". Any suggestions? Code:
View Replies
View Related
I am using some code like the one below to work with a text file, modifying
its lines one by one:
Set objFS = Server.CreateObject("Scripting.FileSystemObject")
Set objF = objFS.OpenTextFile("MyText.txt", 1)
Do While objF.Line <= 26 ' --- I am reading only certain lines
'--- get entire line
strTemp = objF.ReadLine
'--- do some other stuff here
Code:
View Replies
View Related
I have a text area in my asp page:
"code"
<textarea name="content" rows=10 cols=60>
</textarea>
"end of code"
Is there any way to fill the text area with the value of a variable?]
View Replies
View Related
i'm converting an image file to hexa..then the hexa is saved to a text file..
can any one help me how to read the content text of a text file?...
im doing it this way because i don't want to save hexa in my database, because it makes the database slower to open up.
View Replies
View Related
This thread is not so much a big problem, but more to receive comments on my approach. You may have some other tips or advices of where to go or where absolutely not to go with my attempts. Code:
View Replies
View Related
Does anyone know of a method of converting text files to sound files (.wav, mp3 etc) which can be accessed from ASP?
I have an ASP-based website that enables users to design choreography for equestrian dressage. The resulting design is held as a series of coded movements in a database and it can then be reproduced as text or as a series of diagrams. I would like to offer the option of an audio version.
View Replies
View Related
I have an ASP page that is the basic 'home' location for all of my clients who log into my website. In the user_area.asp page, it calls for some common elements with an #INCLUDE FILE statement that are standard and not variable.
If I have a field in my Cutsomer Data Base (.mdb) called 'Custom2' and that field would contain a URL to something like:
mysite.com / clients / clientname / personalpage.asp
What I would need to do is be able to use the #INCLUDE FILE statement to call for the 'Custom2' field so that I could include the clients 'personalpage.asp' within the "home" my 'user_area.asp' page.
View Replies
View Related
Does anyone have knowledge of converting text file to .iff file. I am working on a VB ASP application. I searched for example on internet but I didn't get anything.
If you have any idea of converting text file to .iff file (VB ASP) please share with me.
View Replies
View Related
I want to read an asp file as a text file. The problem is that the file that I want it to read is located on a server. For example: I want to read te content of this file: http://www.bnro.ro/Ro/Info/default.asp . I want to look after some values in that file.
View Replies
View Related
What's the code for reading a TXT file and assigning it's contents to an ASP variable?
create variable
open a text file... read it's contents into the variable
.... perform string manip. on the variable... etc etc...
View Replies
View Related
It is possible to add variable into the include file.
<!--#include file="../info/<%=strfoldername%>/notetosomeone.asp"-->
strfoldername is from my database. It doesn't work. Anyone knows how to solve this problem. Or has other way to do it.
View Replies
View Related
I have two asp files. I would like to call a variable from one of the asp files to another one.
first.asp file activated it has the following variables that I want called by other files.
demoName="Test demo"
salesPersonEmail="first.last"
specificURL="testURL"
The other asp file should be able to call on this information, and then place it in various areas.
View Replies
View Related
is it in any way possible to include a file specified by a variable name?
View Replies
View Related
I have tried a lot, every time my attempts end up with restarting my computer to have the IIS running again.
View Replies
View Related
I'm using ASP to run a batch file. I need to know how to pass a variable to this .bat file.
Is this possible? I'm using the following code but need to know how to pass ASP variable.
set wshell = server.createobject("wscript.shell")
wshell.run "c:file.bat"
set wshell = nothing
Any ideas? Or a work around?
View Replies
View Related
I'm attempting to include a file within another file using Server.Execute. This works fine... however, I need to pass the value of a variable defined within the parent file to the one included via Server.Execute.
From what I've read, the included files are processed before the parent files, so it seems as though the variable is getting lost. Is there any way to internally (not relying on query string) to pass a variable to an included file?
View Replies
View Related
I want to copy a file from a variable location
"C:...myDocument
hisfile.txt" to a destination D:data
How can I do that? I tried to get the path from <input tyep=file>, but I couldn't pass this value to the filesystemobject.
View Replies
View Related
I m creating a cookies in my application and it work properly but i can't see the cookies where it will sotred i checked the cookies folder but i didn't find that I want to create a cookies file as the other web site create and store where other cookies will stored in Cookies folder or Temprory Internet files folder eg:1. arvind@google.co[1].txt this stored in cookies folder 2. arvind@msn[2].txt ....
View Replies
View Related