Reading Tab Delimited File Into An Array

I'm trying to read a tab-delimited file into an array so I can pick out different fields for a report. I keep getting a "Type Mismatch" error that I don't understand.

sReceiveFile = "receipt.txt"
sDataFile = sReceiveFolder & sReceiveFile
sDelimiter = "Chr(9)"

Dim objFileSystem, objFile
Set objFileSystem= CreateObject("Scripting.FileSystemObject")

Set objFile = objFileSystem.OpenTextFile(sDataFile,1)
sReadLine = objFile.readline

Do While objFile.AtEndOfStream <> True
Response.Write "<UL>" & Chr(10)
'Response.Write objFile.ReadLine & "<br>"
sSplit = split(objFile.Readline,"Chr(9)")
Response.write sSplit ' I want to see the contents and this line is giving me the error
Response.Write "</UL>" & Chr(10)
Loop
objFile.Close

%>

View Replies


ADVERTISEMENT

Read Tab Delimited File Into An Array With ASP

I need to read a tab delimted file into an array with ASP. Should be
easy enough, I know it is in Perl and PHP. Can someone show me how
that's done or post a link to an example.

This is what I'm trying to do in perl:

#!/usr/bin/perl -w

my $file = "myfile.txt";
open(FILE, $file);
while(<FILE>){
my ($f1, $f2, $f3) = split(' ', $_); # or @array = split(' ', $_)
print "F1:$f1 F2:$f2 F3:$f3
";
}
close(FILE);

View Replies View Related

Reading Array Elements From A Txt File

i am able to read from a txt file and this is the code:

View Replies View Related

Reading Text Delimited

I have the below code found on an ASP site.

<%
arrName = Split(Request("TextArea"),",")
%>
<%
For i = LBound(arrName) To UBound(arrName)
Response.Write "ID: " & arrName(i) & "<br>"
Next
%>

I'm using a TextArea box to submit the following...
A123,1
B123,2
C123,3
Results are...
ID: A123
ID: 1 B123
ID: 2 C123
ID: 3
I expected something like...
A123 1
B123 2
C123 3
For the sake of understanding, why are the results like above?

In the end, I want to insert these values into a table.
A123 into Field1 .... 1 into Field2
B123 into Field1 .... 2 into Field2
C123 into Field1 .... 3 into Field2

Where do I start?

View Replies View Related

Comma Delimited Array

i am trying to run a asp sql query containging many tables. the main table though is a simple ID based table contains all ids from the other tables. Code:

View Replies View Related

2 Dimendional Array From A Delimited String

I need to create a 2 dimensional array from a string with 2 kinds of delimiters
sample string: Code:

View Replies View Related

Checking For Duplication In An Array Or Delimited String

In an application I'm working the user has the opportunity to record the
despatching of one or more items with serial numbers.

For each item they despatch, they have to chose the serial no that they want
to despatch from a list of available ones. In many cases, these items will
be of the same time, so the dropdown of available serial no's may be the
same. Code:

View Replies View Related

Read A Tab Delimited File In Asp

I need to be able to read a tab delimited text file with an asp page so that I can stuff the fields into a sql table.I really don't know how you can do that, I checked the books I have and have been running around the internet trying to find the answer when I found this site.I cannot use a bulk insert statement because I don't have that level of access to the sql server. and I was assured that "BCP is indeed a command-line only utility and cannot be launched from ASP. You could parse the text file with ASP and generate INSERT statements that you then execute against the database. Routines for parsing tab-delimited files can be had by searching for them on google quite easily." by the system administrator

View Replies View Related

Read Tab Delimited Text File

Anyone know the best way of Read tab delimited text file, its old but I have to use it, I only know how to read csv.

View Replies View Related

Importing Comma Delimited File

I've been asked to develop a semi-automated type situation where we have a
database table (sql server) and periodically, there will be a comma
delimited file from which we need to import the data, replacing the old.

I naurally know that we can use [truncate tablename] to kill the other data,
but does anyone have any examples of importing a comma delimited file into
SQL Server with ASP?

View Replies View Related

Create Comma-delimited File From .asp Recordset

Is it possible to have a search page that queries a sql database and then writes the results to a comma-delimited text file instead of displaying the results.

I have no problem creating the search page and displaying the results I just don't know how to create the comma-delimited text file from the recordset results.

View Replies View Related

Form To Comma Delimited Text File

how to create a comma delimited text file from an asp form. Assume my fields are: Name, email, phone number.

View Replies View Related

Populate A Select List From A Comma Delimited Txt File

I would like to use ASP to populate a select list from a comma delimited txt file.....

View Replies View Related

Reading File

I have a routine I'm writing to read the contents of a file and modify it. However the file will not parse properly into an array, so I strongly suspect I'm using the wrong character to parse the file. The line of code that is supposed to parse the file is:

arrLines = Split(sFileContent, vbCRLF)

When I view the array, it appears as one continuous line, but when I open the file in a file editor it's very clear there are 15 lines.

View Replies View Related

Reading An Xls File

I've got a league standings file that gets uploaded as an xls file. To display the contents, I'm not sure what the most efficient way is:

1.) Import the xls file into a database every time the file is updated

2.) Read the contents of the xls file using OpenDataSource or OpenRow Set

3.) Something I haven't thought of yet!

View Replies View Related

Reading A Sql File

I've to got a login script, but in the middle of the verification script, I'd like once the vify has been ok'd to look for a sql file, that has insertion data in it, once the file has been found the asp code must read and carry out the sql command (insert the data in the access db), once done the sql file gets deleted. Code:

View Replies View Related

Reading From Csv File And ,

Im having a bit of trouble with taking a csv file and sperating each row with a "," because we all know that csv's are serpated by cammas, my problem is the rows are getting messy because say I have for the first Collum "Toy, Really fast", it will seperate the collum name because of the , Is there any way I can remove these or whats the best way.
Heres my code right now: Code:

View Replies View Related

Reading File

I am developing a web page, in that i have to get user's photo from user and insert it in to database. how to upload this photo from local drive to my server

View Replies View Related

Reading XML File

I am trying to read in an XML file I don't know the node/structure,so I basically just want to load in the file and then print out the entire file on the page through Response.Writes. how do I loop over the nodes if I don't know the names?

View Replies View Related

Reading An Xml File

i want to 'grab' an rss news feed from a public site that has the xml file published on an hourly basis. how do i do this in asp?

View Replies View Related

Reading TXT File Into A ASP Variable

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

Reading Xml File By Node Name

how can i read a xml file using the node item name.

one example:

i could use:

root.childNodes.item(0).childNodes.item(0).text

but instead of that, i want something like this:

root.childNodes.item("item_name").childNodes.item("sub_item_name").text

is it possible ? how can i do that ?

View Replies View Related

Reading File From Server

Consider the following code snippet:

<%
Dim objFSO,objOpenFile,strPath

strPath=Server.MapPath("ADList1.txt")
Set objFSO=Server.CreateObject("SCRIPTING.FILESYSTEMOBJECT")
Set objOpenFile=objFSO.OpenTextFile(strPath,1)
Do While Not objOpenFile.AtEndOfStream
Response.Write(objOpenFile.ReadLine() & "<br>")
Loop
objOpenFile.Close
Set objOpenFile=Nothing
Set objFSO=Nothing
%>

When I try to execute the above code, the code never gets executed. Neither
am I shown a script timeout error. After a lot of investigations, I
concluded that the code is not getting executed due to the presence of

Set objOpenFile=objFSO.OpenTextFile(strPath,1)

If I comment line nos. 3 to 8, then the code gets executed but as expected
without any output. Is this happening because of some permission which has
not been given to IIS 5.0? If so, what is it? I am working on Windows 2000
Professional.

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

Reading File From A Server

I understand i can not use Scripting.FileSystemObject to read a file that resident on another server and i need to use something else.

View Replies View Related

Reading Text File

I have a form that updates a text file. This text file writes variables (i.e. username = tom). This file is used to preview an HTML page and when you go to the form the variables are populated into the form fields again.

For some reason when someone else modifies the text file (using the form) I only see the old contents in the form fields. When I look at the preview HTML file, however, everything is fine.Why doesn't the form re-populate with the new info?

View Replies View Related

Text File Reading

i have a variable 'user', and a text file 'users.txt'. how can i search the text file and select the line thats the same as the variable 'user', then put that line into a variable?

'user' = 'root'

'users.txt' =

testuser1|kfkfjd
root|18273
test2|fjfkds

View Replies View Related

Reading A Text File

I need to create something that will read a text file and send e-mail statements from that text file. I know this is a basic application, but I am not sure where to start with this. The text file already contains all of the information for the statements. It is one file that starts with the customer e-mail address and then separates each statement by an <eob> marker. I need to be able to browse to upload the file and then have the application cycle through and generate all of the e-mails. I don't need to do any formatting to the text file, just read it and send the e-mails. The server currently uses CDOSYS to send other e-mails from a shopping cart application.

View Replies View Related

Reading From Text File

I have some messages in a text file.I would like to read one message every day from the text file. My Text file looks something like this

If you take medication for your blood pressure, you may need to be wary of adding certain pain relievers to your system. A class of pain-relieving anti-inflammatory medication often used to treat arthritis may interfere with a common blood pressure medication, according to research. The hash is just for demarcation. As I havent worked much with FileSystem can anyone help me how to go about acheiving the same.

View Replies View Related

Reading File In Backwards

I have a text file which I would like to read from the end and display only a certain number of records. Is there any way of doing this?

View Replies View Related

Reading Excel File!

how can i read the excel file from asp or from javascript.

View Replies View Related

Reading File From A Server

i understand i can not use Scripting.FileSystemObject to read a file
that resident on another server and i need to use something else.

View Replies View Related

Reading With Input Type File??

I m using

<input type="file" name="abc">

But when I retrieve the contents sent after browsing the file from the system using

Request.Form("abc")

the retrieved value is null, ie., blank.

Why is that occuring??

View Replies View Related







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