Sponsored Content
Top Forums Shell Programming and Scripting input text from file into 2d array Post 302246689 by pietie on Tuesday 14th of October 2008 06:32:53 AM
Old 10-14-2008
Quote:
Originally Posted by jim mcnamara
Code:
my @data = ['Project', 'HW1', 'HW2', 'HW3', 'MidTerm', 'Final'],
            [25, 6, 7, 2, 25, 35];
print $data[0][1] "\n";   # first row second column

creates a matrix - your two D array. IS that what you want?
hi Thank you for your reply. It put me on the right track, and now I have the text file in a matrix(2d array). Regards
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

input text into file

hello everyone, this is my first time posting here so be nice ;-) I am a bit new at unix scripting and have basically been hacking other peoples scripts to get them to do what I need. I have now hit a bit of a stop. This problem is very basic but I can't just seem to figure out how to get... (1 Reply)
Discussion started by: cannonfodder
1 Replies

2. Shell Programming and Scripting

Replace text in input file

I wish to replace values of specific parameters in an input file for batch runs of a java code. It's essentially a nested for-loop sorta like this: valuearray1 contains values for param1 valuearray2 contains values for param2 for (all values in valuearray1) go into specific position in... (2 Replies)
Discussion started by: daphantomica
2 Replies

3. Shell Programming and Scripting

Pipe text from a file into an array

Hi Guys I have a question about filling up an array I have a file called USER_FILE.txt it contains the following: Real Name:Thomas A Username:THOMAS_A Real Name:Thomas B Username:THOMAS_B Real Name:Thomas C Username:THOMAS_C Real Name:Thomas D Username:THOMAS_D Real Name:Thomas E... (8 Replies)
Discussion started by: grahambo2005
8 Replies

4. Shell Programming and Scripting

input text at certain lines of a file

Hi, I have an xml file which will be edited by the user. I would like to get input from user and insert that at line 40 of the xml file. PLease can some one help me to know how to insert the text at specified line using shell script. (6 Replies)
Discussion started by: sunrexstar
6 Replies

5. Shell Programming and Scripting

help with using text file as input

Hello All, I'm attempting to use a text file as input to a specific field in a command. Below is the command... Typically it looks like this ans_dump testzone.com channel=dnsw32 | grep AAAA I have about 500 zones I want to check... how do I use my text file as input where the zone name... (2 Replies)
Discussion started by: spartan22
2 Replies

6. Shell Programming and Scripting

Read text file and use it as input

I need to take a text file that holds a bunch of data and run each the stuff in it as an input for the program. the file would hold stuff like this: thing1.awesomesite.com 80 123.456 thing2.awesomesite.com 80 789.098 thing3.awesomesite.com 80 765.432 ... Now I already know the... (1 Reply)
Discussion started by: shade917
1 Replies

7. Shell Programming and Scripting

Efficient population of array from text file

Hi, I am trying to populate an array with data from a text file. I have a working method using awk but it is too slow and inefficent. See below. The text file has 70,000 lines. As awk is a line editor it reads each line of the file until it gets to the required line and then processes it.... (3 Replies)
Discussion started by: carlr
3 Replies

8. Shell Programming and Scripting

Array & text file

Hi all, i have a text file such as: 10 17:54:47,213 10 17:54:47,214 10 17:54:49,338 10 17:54:49,399 10 17:54:50,402 10 17:54:50,403 11 17:54:47,213 11 17:54:47,213 11 17:54:49,362 11 17:54:49,422 11 17:54:50,429 11 17:54:50,429 11 17:54:50,429 11 17:54:50,429 11 17:54:51,510 12... (10 Replies)
Discussion started by: sbamap
10 Replies

9. Shell Programming and Scripting

Add input to text file

In the attached bash file I am trying to add a block of code to add2text that will copy the input from match to a text file (file.txt). For example, if from the menu choice 1 is select the user is asked for the id.... lets say that is 12345, after that id is matched and converted can it be added... (22 Replies)
Discussion started by: cmccabe
22 Replies

10. Shell Programming and Scripting

Copying a file to multiple other files using a text file as input

Hello, I have a file called COMPLIST as follows that contains 4 digit numbers.0002 0003 0010 0013 0015 0016 0022 0023 0024 0025 0027 0030 0031 0032 0033 0035 0038 0041 (3 Replies)
Discussion started by: sph90457
3 Replies
Jifty::Plugin::Chart::Web(3pm)				User Contributed Perl Documentation			    Jifty::Plugin::Chart::Web(3pm)

NAME
Jifty::Plugin::Chart::Web - Base class to add to Jifty::Web's ISA DESCRIPTION
When the Jifty::Plugin::Chart is loaded, this class is added as a base class for Jifty::Web to add the "chart" method to that class. METHODS
chart Jifty->web->out(Jifty->web->chart(%args)); The arguments passed in %args may include: type This will be one of the following scalar values indicating the kind of chart. A given renderer may not support every type listed here. A renderer might support others in addition to these, but if it supports these it should use these names. points This is the default value. A scatter plot with each dataset represented using differnet dot styles. lines A line plot with each dataset presented as separate line. bars A bar chart with each dataset set side-by-side. stackedbars A bar chart with each dataset stacked on top of each other. pie A pie chart with a single dataset representing the values for different pieces of the pie. horizontalbars A bar chart turned sideways. area An area chart uses lines to represent each dataset, but the lines are stacked on top of each other with filled areas underneath. width This is the width the chart should take when rendered. This may be a number, indicating the width in pixels. It may also be any value that would be appropriate for the "width" CSS property. Defaults to "undef", which indicates that the chart will take on whatever size the box it is in will be. See "CSS FOR CHARTS". height This is the height the chart should take when rendered. This may be a number, indicating the height in pixels. It may also be any value that would be appropriate for the "height" CSS property. Defaults to "undef", which indicates that the chart will take on whatever size the box it is in will be. See "CSS FOR CHARTS". data An array of arrays containing the data. The first array in the parent array is a list of labels. Each following array is the set of data points matching each label in the first array. Defaults to no data (i.e., it must be given if anything useful is to happen). class This allows you to associated an additional class or classes to the element containing the chart. This can be a string containing on or more class names separated by spaces or an array of class names. renderer This allows you to use a different renderer than the one configured in config.yml. Give the renderer as a class name, which will be initialized for you. options This is a hash containing additional options to pass to the renderer and are renderer specific. This may include anything that is not otherwise set by one of the other options above. Here's an example: <% Jifty->web->chart( type => 'Pie', width => '100%', height => '300px', data => sub { [ [ 2004, 2005, 2006, 2007 ], [ 26, 37, 12, 42 ] ]; }, class => 'visualizeronimicon', ) %> Be sure to output anything returned by the method (unless it returns undef). CSS FOR CHARTS
The chart API allows you to build the charts without explicit pixel widths and heights. In fact, you can not specify "width" and "height" and perform the styling in your regular CSS stylesheets by using the "chart" class associated with every chart or by using custom classes with the "class" argument. See your renderer class documentation for further details. JAVASCRIPT FOR CHARTS
Charts typically require JavaScript to render properly. If the client does not have JavaScript available, the chart may not work or could look very bad. If you are using one of the image based renderers like Jifty::Plugin::Chart::Renderer::Chart, it is recommended that you stick with pixel widths if you expect clients with limited or no JavaScript support. SEE ALSO
Jifty::Plugin::Chart, Jifty::Plugin::Chart::Renderer AUTHOR
Andrew Sterling Hanenkamp "<andrew.hanenkamp@boomer.com>" COPYRIGHT AND LICENSE
Copyright 2007 Boomer Consulting, Inc. This is free software and may be modified and distributed under the same terms as Perl itself. perl v5.12.4 2009-03-09 Jifty::Plugin::Chart::Web(3pm)
All times are GMT -4. The time now is 03:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy