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


ADVERTISEMENT

Line Number

ive been looking on here for a while and i have to say what a great resource. i wondered if anyone could help me out with a slight problem ive stumbled across today in ssociation with line numbers?

im reading the contents of a text file into a variable, and using a regular expression to locate certain criteria, and the number of matches found (main reasoning for reg exps). but i also require the line numbers of each match from my search to take a copy of these lines contents. i think it could be a difficult one, i just wondered if anyone could help out or point me in the right direct?

View Replies View Related

Error´s Line Number

Is there a way to catch the line number of the error in production without
visual studio installed?
obs: Local I see the line number

View Replies View Related

Error Line Number

I have a page that whenever an error occur, I send an email to support
with the error description, script name, server, referer, etc...

However, I want to add the line number to the email message. So far, I
have found that you would have to modify the custom error (500;100) on
the IIS to point to your own error page to be able to use the
Server.GetLastError object.

Does anyone know if there is a way out there that does not require
changing the IIS settings?

View Replies View Related

Convert Real Number Into Text Number

I need to insert some number into database as text. My problem is if I insert the number (ie. 4.0), the value in the database only show (4). So, is it possible to convert a real number into text number using ASP?

View Replies View Related

Displaying Recordset Line Number

I have a recordset that displays hundreds of records, I would like to display a row number next to each record in the order of 1, 2, 3 etc.

View Replies View Related

VBScript Runtime Error (with No Line Number)

I am getting this error:

Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'sid'
/beta/files/index.asp

There is no line number, and there is absolutely nothing on that page
using sid, and I mean not even a word, or even part of a word, in that
document or any of the include documents.

I have put the files from the production server back from the past
three days, and I am still getting this error.

It happened very suddenly, when I was made a change to a css file.
Yes, I know that CSS is client side and has no effect whatsoever on the
server, but there it is.

Does anyone have a clue about this? All the Googling has resulted in
errors with line numbers. Heck, if there were a line number, I
wouldn't be posting here - I'd fix it.

View Replies View Related

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

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

How To Convert Number To Text

I am making a check writing page and was wondering how to convert a variable in the form of $1234.56 to One Thousand Two Hundred Thirty Four Dollars and Fifty Six Cents (Or something like that).

View Replies View Related

Number To Text Conversion

Im working on a number to text conversion in ASP, just like this : 456 = four hundred fifty six. If you have any cool function, In case you don't, how can I analyze the caracters of a number one by one, and know how much caracters a string has?
Ej = "1234" has 4 caracters

View Replies View Related

Convert Number To Text

I need to modify some code written by someone else that sends out an automated email based on a form submittal. In the form, values are set to 1 or 0 for "yes" or "no". I need to modify it so that the email changes the 1 or 0 to their text equivalents (yes/no).

I CANNOT modify the form itself to change the variables, so i assume i need an IF stmt to that converts the string to text before it sends. Can someone point me in the right direction for how to do this?

View Replies View Related

Convert Number To Text 1 To One

is there anyway to convert a number into a text string? i.e. 1 to one or 2 to two.

View Replies View Related

Min Number Validation In Text Field

i know in html you can set a "max" character limit for a form field.I was wondering if it is possible to set a min number of characters?

View Replies View Related

What Is Easiest Way Convert Number To Text

what's the easiest way to convert a number to text i.e.

2005 --> two thousand and five
67 --> sixty seven

View Replies View Related

Change Format From Number To Text.

i have several fields in the database that the format is number. then, i have a report page that allow user to open it the ms excel. my problem is, when all data transfered to ms excel, all data that is in number format, they are located at the right of the cells and there is 1 data named noIC, suppose this data is a 12 digits number but in the ms excel, it became something like this 780945+E12....

to solve this problem, i have to change the cell's format everytime all data have been transferred to ms excel. i have to set to left indent for all fields that contain numbers and for the noIC i have to set from General to Number.

View Replies View Related

VBasic Text Field (phone Number) Calculating Data Before Inserting Into Access

I have a text field in a web page I am working on that seems to be calculating phone numbers before inserting them into an Access database. i.e., 867-5309 will result as -4442 in the Access text field. My guess is that the webserver or client is processing it before inserting it. Is there any way to stop this other than using a validation script?

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

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

Sequential Number After Batch Number

here is the scenerio

in master batch table i have various master batch like
200701-0001
200701-0002
200701-0003

Now each master batch can have multiple final mixed batch like

200701-0001-01
200701-0001-02
200701-0001-03

and this record is inserted in to fmix table.

so i have a form in which i have a dropdown menu in which all the master batch is listed,
i select 200701-0001 and that value is passed to next page where i will enter other fields data and insertion to my fmix_no will be done automatic like 200701-0001-01, 200701-0001-02 and so on,

how to achieve this

so in short each master batch will have more than one final mixed batch.

pls help, also if u have any online contact in yahoo or msn pls send me, i am so confused and badly struck deadline is just couple of hours away. my yahoo id is(E-Mail address blocked: See forum rules) you can PM me i am online right now.

View Replies View Related

Retrieve The Error Number In VB With Err.Number

I want To handel the error messages by myself in one part in my script. I know that in VB I can Use the statment - On error resume next And I also know that I can retrive the Error Number In VB with Err.Number.

How can I handel the errors by myself in ASP? I heard about the ASPErr Object, Is it the same thing like the err object in VB?

View Replies View Related

Controlling Text In A Text Area Or Text

I have this problem in controlling a the text in a Text Area. How can I do
that for example the field size is 200, when it reaches 50 it automatically
goes to the next line. Bcoz im having problem when viewing it in my report,
it continuesly views in a strieght line and im having problem in printing.

View Replies View Related

International Text And FSO Created Text Files

When using ASP's FileSystemObject to create text files, I am unable to get user submitted text (in Hebrew) to save as anything other than "?????". The text file is being saved in Unicode and setting the CodePage in ASP proved unsuccessful. Strangely, hard coded Hebrew text in an ASP variable does add to the text file correctly.

Any ideas of why this happens and how to get it to work correctly?

View Replies View Related

End Of The Line

I have this textarea and I inputted this;

Quote: asp
xml
xhtml

If I update/save this to a database(msaccess) and view this in a browser it gives me a one line record like;

Quote: asp xml xhtml

but I dont want to put every end of the line a <br> tag for me not to view a one line record, how do I do this?

View Replies View Related

New Line To Br

PHP has a function called nl2br() which inserts HTML line breaks before all newlines in a string. Is there an ASP equivalent to this?

View Replies View Related

New Line

I've managed to code a function that will straightly replace some given character to another, for security of my pages. For example, I can convert (") to " and (') to ´ ..etc in the form(text field) that allow user to post some data to be stored in the db. But then I don't want the user to write it in HTML tag, and I want that when user press [Enter] on the keyboard, then I can redisplay the message in the way that the user really type in (new line). What I'm thinking is if I can replace the [ENTER] pressing to <br> to be stored in my db. But I didn't found the way I can do that.
/n such as in c++ didn't solve. Anybody knows? I use ASP VBscripts/
Does my question clear?

View Replies View Related

4 Line PHP

I have this small 4 line PHP code and I would really like this to work with ASP, can anyone dp this for me?Code:

<?php

$tempVar = 'http://www.temp.com';
$feed = file_get_contents($tempVar);
header('Content-type: text/xml');
echo $feed;

View Replies View Related

Err.line

I am trying to trap my ASP errors using the ASP error object.
Everything works almost fine, but I can't retrieve the line number where
the error occured. Here is a little piece of my code:
==========================
If Err <> 0 Then
Response.Status = "500 Internal Server Error"
Response.Expires = 0

Dim ErrorContent
ErrorContent = ErrorContent & "Description: " & Err.Description & vblf
ErrorContent = ErrorContent & "Line: " & Err.Line & vblf
ErrorContent = ErrorContent & "Number: " & Err.Number & vblf
ErrorContent = ErrorContent & "Source: " & Err.Source & vblf

View Replies View Related

Line Mean

What does this line mean?

streamFile.SaveToFile m_sUploadFolder & fileItem.FileName, 2

View Replies View Related







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