Using FSO To Replace A Line In A Text File

I have a text file named "enterintro.bat". The contents of the file are:

@ECHO OFF
start /w C:skAppActivate.vbs "F4 Event and Entity"
start /w Sleep.vbs 2
start /w C:skSendKeys.vbs "BEC201_IPA{TAB}IPA_SS{ENTER}^S"

What I'm trying to do is to be able to swap out the "BEC201_IPA" and "IPA SS" with different variables. The format of the text file should never change except for swapping out these values. I've used the OpenTextFile method before, but only to append lines to a file, and never to replace an existing line, and I'm not sure how to do it. The best I've come up with so far is this: Code:

View Replies


ADVERTISEMENT

Delete Line From Text File

if I had a form using the input textboxes using username and password. how do I use the .asp language to remove the line from a .txt using the following format:

username<space>password

View Replies View Related

Delete A Line In Text File Or From An Array

I have an Access DB with newsletter preferences in it. What I am trying to do is select small groups to send a custom newsletter out to. So my localhost criteria web page goes to the Access DB and pulls the email addresses that match my current criteria. I then write that list out to a file (newsletterlist.txt). Maybe that is my problem, but I wanted to do that so if my machine crashed while processing, I would know where to recover it. I had looked at arrays and dictionaries but dictionaries aren't good from what I found for hundreds of entries and arrays I can't keep track of..argh.

Anyways, I then wanted to loop through the file (newsletter.txt) find the next email address, with it I can query back to the DB and get preferences and assemble the email and out the custom newsletter goes.

I've seen where MS says deleting a line using the FileSystemObject is not possible, though wanted to see if anyone has found a work around.

Performance isn't that much of an issue for me, as I figured I'd set the thing to running and go to dinner! So anyone have suggestions - even if it means taking the text info to an array, somehow delete one of the addresses and then put it back to a file...anything that can one by one delete the addresses so I know that it all has worked as there would be no email addresses left in the file.

View Replies View Related

Deleting Specific Line From Text File FOUND!

After looking all over the place and finding codes in vb and in php I even had asked several people on other boards but none of them knew how to do it I say the best way to learn this .asp .aspx junk is to DO IT yourself although Ive scripted in the past with the mIRC client which is why I know programming and html but if anyone is looking for the code this is how its done Code:

View Replies View Related

Read Text File By Line And Values Separated By Tabs

I have a log file from my email software program. Each entry is on a line and the values are seperated by tabs. How can I read through this text file such that I insert its contents into a database? Thanks. Tom

Here is one entry from that file:

11/30/06 00:00:21SMTP-IN25AA24076F2041D7B35E97EE7748D06C.MAI65284.244.91.208EHLOEHLO [84.244.91.208]250-home [84.244.91.208], this server offers 4 extensions11922

View Replies View Related

New Line Replace

On my page,I have a text box,in which a user can enter text to submit to a MySQL database.For example, a user types:

Quote:
This is text line 1

This is text line 2

What I want to happen is before it is sent to the database, convert these spaces in between the lines to <BR>'s, so it'll be:

Quote: This is text line 1<BR><BR>This is text line 2

If I don't do this, it'll appear (when I query the database) as:

Quote: This is text line 1This is text line 2

What code must I use to make this happen?

View Replies View Related

Replace Sql String Line

I'm executing a stored procedure where I have the values hard-coded. I need to replace the hard-coded values with variables.Here is the hard-coded line:

Query_Allo_Amt = "exec app_get_alloc_ABR 'STRATEGY', 'AUS', 2005"

I need to replace STRATEGY with cmdAlloAmts__alloc_type, AUS with cmdAlloAmts__ddo, and 2005 with cmdAlloAmts__ay. I've made several attempts at replacing the hard-coded values with the variables and come up with different error messages. How can I replace the hard-coded values with variables in the above line?

View Replies View Related

Replace() Multiple Characters On One Line?

can you replace multiple characters with only one line of code?

View Replies View Related

Read Txt File Line By Line

I have an encrypted .txt file created by asp. Its formatted with lines etc. Title followed by description underneath. I need to read this into ASP now, and parse it line by line. On each line read, run the function to unencrpt and add line to a new file.

Its the line by line Im having trouble with. If i do the full textstream no formatting takes place coz im adding the fulltextstream all in one addline call. How can I loop through lines ?

View Replies View Related

Getting Line Number Of Text

I'm trying to find the line number of a specific piece of text:

do while textFileOpen.AtEndOfStream=false
if textFileOpen.ReadLine=text2Find then
foundAt=textFileOpen.Line
end if
Loop

But it keeps giving the wrong line number

What I'd like is foundAt to be 0 then if the line is found foundAt is to be the line number, if it is not found stay at 0

In the script above foundAt at increments even though the text isn't in the line?

I also get a "Input past end of file" if text2find isn't found

View Replies View Related

Split () Then Replace () Text Box Input

I have a form with an text box called keywords. I want to get the text typed in by the user from this box (which will pobably be built up of several words).

I have declared arrsplitkeywords to assign these words to. But first i have split the input from the text box where there is a space. See the line of code below:

arrsplitkeywords = Split(Request.Form("Keywords"),",")

I now need to replace this so that the words are split up to be split like "','" I have the following line of code to do this:

Replace(arrsplitkeywords,",", "','")

This doesn't appear to work, and on the replace line i get the following error:

Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement

Any help please as to why this isn't working?

View Replies View Related

Detect New Line In A Text Block

If I have a long text which I copied from a Word document and pasted it into
asp in order to output it into HTML, how do I detect new line in the text
and insert Line Feed Carriage Return?

View Replies View Related

Current Line In An ASP File

ASPError object gives the current line where error occurred. Is there a way to find out the line where Err.Number became non-zero due to a Server.CreateObject(...) failure?

View Replies View Related

Writing In File Add Extra Line

I am writing one line and for a reason I ignore it adds a line which is screwing up a few things.

<%
Set fso = CreateObject("Scripting.FileSystemObject")
dim sLine sArchivo="switch.txt"
path = Server.MapPath("../Flash")
sFile = path & "" & sArchivo

if fso.FileExists(sFile) then
fso.DeleteFile(sFile)
end if
Set a = fso.CreateTextFile(sFile, True)
if request("radiobutton") = 1 then
sLine = "&ver=si"
else
sLine = "&ver=no"
end if

a.WriteLine (sLine)
a.Close

sRedirect="admin_NoticiasListado.asp?sRadio=" & request("radiobutton")
Response.Redirect(sRedirect)
%>

How come does the extra line come ? I seems I have done already a fews times and it never ocurred before.

View Replies View Related

Include A Line In .HTML File

is it possible to include a line of asp in a .html file?

View Replies View Related

How To Stop It Read The Datas In The Next Line In .csv File

i wrote this code to read the datas from excel(.csv file). but it read all the datas as 1 line. i don't undestand why.is there any function that i can use to stop it read the datas in the next line?? can anyone help me?? thanks a lot.

Do While Not TextStream.AtEndOfStream
line = TextStream.readline

if line <> "" then
arr_User(i) = trim(line)
splitline = split(arr_User(i), ",")

for j=0 to 5
response.Write splitline(j) &"nbsp;nbsp;"
next

i = i + 1
redim preserve arr_User(i)

end if
Loop

View Replies View Related

Read Cell Data Line By Line From Excel

I had created a macro to read data from an excel sheet and write the values to a text file. I had used "ActiveSheet.Range("GB" & k).Value" command to read the values from the excel.some cells in the excel sheet is having two lines value and four lines data, the text file is generating that value in a single line. (Ex. the cell value in address column is in four lines and should display in four lines in the text file generated from the macro)

Can i do something in the excel sheet or in vb script to read the address value line by line and write line by line in text file?

View Replies View Related

Converting An Image File To Hexa, Read Text File

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

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

Converting Text File To Sound File In ASP

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

Converting Text File To .iff File (VB,ASP)

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

Read An Asp File As A Text File

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

Text File

how can i write a line to a text file? also, how can i put every line of a text file into an array - and see whether a value mathes any of the lines in the array?

View Replies View Related

ASP To Text File

I have an asp page that is populated by an access db, I want to create a text file on the server based on the asp file. Then provide a link for people to download that text file. How would I do this quickly?

View Replies View Related

CSV Text File

I've a very small form just a name and a few checkboxes.when user submits the form, we want to store the data in a CSV text file and send an email to one of us here. Has any one had done it before please give me some ideas how to do it.

View Replies View Related

Text File

I'm using ASP 3.0. I'm taking form contents and dumping it into a text file
on the server. how to add the TIME to this statement. I create the text file with the name of file, month, day and year.I would like to add TIME to it.

-------------------------------------------------------------
set fso = createobject("scripting.filesystemobject")

Set act = fso.CreateTextFile(server.mappath("/data/"&g_filename & "-"&
month(date())& day(date())& year(date()) &".htm"), true)
-------------------------------------------------------------

View Replies View Related

Extracting Text From PDF File

is asp code able to do the extraction of text from PDF File without using a third party software?

View Replies View Related

Asp Text File Out Of Memory

I have a page which sends a query to an DB2 using an ODBC. The
results are then written to a text file. I am unable to write directly to
the users drive because of permissions.

The problem I have is that when the
query set becomes too big, I get error '8007000e' Not enough storage is
available to complete this operation. The query is returning 100, 000
records or more. So my question is how do I handle this? Somebody had
suggested to me to chunk the data. Code:

View Replies View Related

Reading A TEXT File Without DB

I would like to know how I could accomplish this without using DB. There's a long text file named "TEST.TXT" The TEST file contains special character 'º' which will be used as pagebreak. I want an ASP page that will read the TEST.TXT file and split it into multiple web pages with navigation control. (eg. <FIRST<PREVIOUS>
<NEXT<LAST)

If it is possible

View Replies View Related

Recordset To A Text File

My original thought was to save the recordset into a text file. However,
because of permissions I am unable to do this and will not be able to change
the permissions. My next thought was to open it in excel. However, the
table is too large and I get the Cell Table: too many rows or columns error.
I need the user to be able to save the records on her computer.

View Replies View Related

How To Read Text File In ASP

I'm write an asp to include part of a text file into my asp output html, I use FileSystemObject to get the content of the text file, but the asp just hang when it runs, the source code is listed below if anyone could help: Code:

View Replies View Related

Writing To A Text File

I am new to working with ASP and I would like to know
the code to create a textfile on the serer and then write
something in it using ASP.

View Replies View Related

Save As Text File And Zip

I want to loop through a recordset and save each records contents as text files and then zip all the text files and promt user to download the zip --- can this be done?? Does anyone have any code?

View Replies View Related







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