473,385 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Read tab delimited file into an array with ASP

Rob
Hi,

Sorry if this has been asked before(I searched, but didn't see
anything).
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('\t', $_); # or @array = split('\t', $_)
print "F1:$f1 \t F2:$f2 \t F3:$f3\n";
}
close(FILE);
Jul 19 '05 #1
1 7929
Hi Rob:

you can scripting filesystem object to read the file per line.

While each line is being read, you can use Split function and use the returned array and manipulate teh same.
--
================================
Deepak Kumar Vasudevan
CS Software Solutions

Phones: +91-44-2819-1336 thru 38
91-98400-26014
www.cssolutionsinc.com

Mailbox Protected by SpamPal (http://www.spampal.org.uk/)
================================
"Rob" <re******@NOSPAMbedford.net> wrote in message news:#i*************@tk2msftngp13.phx.gbl...
Hi,

Sorry if this has been asked before(I searched, but didn't see
anything).
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('\t', $_); # or @array = split('\t', $_)
print "F1:$f1 \t F2:$f2 \t F3:$f3\n";
}
close(FILE);
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: jrlen balane | last post by:
how would i read a tab delimited file? at the same time put what i read in an array, say for example that i know that the file is an array with column= 5 and row=unknown.
3
by: Brian Kitt | last post by:
I have a .CSV file that I need to read, reformat, and write back out as a TAB delimited file. I can't use a slick utility such as DTS, because I have a lot of tweaking I need to do on the data...
3
by: JenHu | last post by:
Hi, I want read line by line and characters. The characters are fix length text file, no specific delimited method between each fields. The first line is header line, the last line is footer. ...
3
by: Avi | last post by:
I need to create a text file that has the data from the 10 tables in the database. The number of fields in the tables exceeds 255 and so I cannot make a new table with all the fields and then...
5
by: Denis Petronenko | last post by:
Hello, how can i read into strings from ifstream? file contains values in following format: value11; val ue12; value 13; valu e21;value22; value23; etc. i need to read like file >string,...
9
by: Adi | last post by:
Hello eveyone, I wanna ask a very simple question here (as it was quite disturbing me for a long time.) My problem is to read a file line by line. I've tried following implementations but still...
23
by: ShaneO | last post by:
Hello, I wish to extract embedded string data from a file using a Binary Read method. The following code sample is used in VB.NET and similar code is used in VB6 - (Assume variable...
2
by: RyanS09 | last post by:
Hi- I have read many posts with specific applications of reading in text files into arrays, however I have not been able to successfully modify any for my application. I want to take a text file...
1
by: nick777 | last post by:
Hope the Community can bear with me as I muddle with the vocabulary since I am not really sure if I am going about this the correct way. My question is as follows: If I had some sample data in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.