?
Solved

array question

Posted on 2003-03-01
1
Medium Priority
?
171 Views
Last Modified: 2013-12-25
I have a data file like the following:
***********************
a,b,c
d,e,f
g,h,j
k,l,m
***********************

As shown it is comma delimited

I want to load on the middle column (b,e,h, and l) into the array:
@numbers

Is that possible?  Or how do I load the entire list into the array but then access just the middle items?
0
Comment
Question by:derek4716
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 48

Accepted Solution

by:
Tintin earned 800 total points
ID: 8049498

open DAT, "data.txt" or die "Can not open data.txt $!\n";
push @numbers,(split(/,/))[1] while (<DAT>);
close DAT;
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question