05-08-2009
storing values in a list or array
i have a file called file.txt having the following entries.
2321
2311
2313
4213
i wnat to store these values in a list and i want to iterate the list using loop and store it in another list
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
All ..
I am having a pointer array . And trying to store the addess into that pointer array . please see below the problem i faced
code:
int cnt1;
char *t_array;
char *f_array;
for(cnt1=0; cnt1<1000; cnt1++)
{
t_array =... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies
2. Shell Programming and Scripting
Hi All,
I need some help with arrays. I need to take input from the user for hostname, username and password until he enters .(dot) or any other character and store the values in the variable array.
I would further connect to the hostname using username and passwd and copy files from server to... (7 Replies)
Discussion started by: nua7
7 Replies
3. Shell Programming and Scripting
hi all
I am using awk utility to parse the file and fetching two different vaues from two different record of a record set.
I am able to see the result, now i want to store the result and perform some check of each values form database to mark valid and invalid.
could you please help me... (3 Replies)
Discussion started by: singhald
3 Replies
4. Shell Programming and Scripting
Hi Guys,
I have a file which is as follows:
1
2
4
6
7
I am trying to store these values in an array in bash. I have the following script:
FILE=try.txt
ARRAY=(`awk '{print}' $FILE`)
echo ${ARRAY} (3 Replies)
Discussion started by: npatwardhan
3 Replies
5. Shell Programming and Scripting
Respected All,
Kindly help me out.
I have got file listings in a directory like this:
-rw-r--r-- 1 root root 115149 2011-11-17 07:15 file1.stat.log
-rw-r--r-- 1 root root 115149 2011-11-18 08:15 file2.stat.log
-rw-r--r-- 1 root root 115149 2011-11-19 09:15 file3.stat.log
-rw-r--r-- 1... (2 Replies)
Discussion started by: teknokid1
2 Replies
6. Programming
I am trying to get userinput from stdin and store the lines in an array.
If i do this:
using a char **list to store strings
allocate memory to it
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv)
{
char *prog = argv;
char **linelist;
int... (5 Replies)
Discussion started by: tornow
5 Replies
7. Shell Programming and Scripting
Am using a find command in my script .The output may be one or more. I need to store those values in a array and need to access those. Am unable to find the solution . Any help on this will be helpful.
if
< code>
else a=<find command output which gives the file name either 1 or more>
if 1... (1 Reply)
Discussion started by: rogerben
1 Replies
8. Shell Programming and Scripting
I'm trying to exlude a list of values with perl to process while reading in a file. Is there a way to use the next if with a list?
Example:
@array = qw(val1 val2 val3 val6);
while (<>) {
next if $_ =~ @array; # values I don't want to process here
print; # process the rest here
}... (8 Replies)
Discussion started by: timj123
8 Replies
9. Shell Programming and Scripting
Hi Community,
Would love to get some quick help on below requirement.
I am trying to process mpstat output from multiple blades of my server
I would like to assign this the output to an array and then use it for post processing. How can I use a two dimensional array and assign these value
... (23 Replies)
Discussion started by: sshark
23 Replies
10. UNIX for Beginners Questions & Answers
Hi,
I have written the below script to get the timestamp of each files and result is as below
Script
find /home/user -type f -name "*.json" -printf '%Tc %p\n' | awk {'print $1 " " $2 " " $3 " " $4 " " $5 " " $6 " " $7'}
Input
-rw-r--r-- 1 user domain users 17382 Jul 19 06:10... (5 Replies)
Discussion started by: nextStep
5 Replies
LEARN ABOUT X11R4
xtgetconstraintresourcelist
XtGetResourceList(3) XT FUNCTIONS XtGetResourceList(3)
NAME
XtGetResourceList, XtGetConstraintResourceList - obtain resource list
SYNTAX
void XtGetResourceList(WidgetClass class, XtResourceList *resources_return, Cardinal *num_resources_return);
void XtGetConstraintResourceList(WidgetClass class, XtResourceList *resources_return, Cardinal *num_resources_return);
ARGUMENTS
num_resources_return
Specifies a pointer to where to store the number of entries in the resource list.
resources_return
Specifies a pointer to where to store the returned resource list. The caller must free this storage using XtFree when done with
it.
widget_class
Specifies the widget class.
DESCRIPTION
If XtGetResourceList is called before the widget class is initialized (that is, before the first widget of that class has been created),
XtGetResourceList returns the resource list as specified in the widget class record. If it is called after the widget class has been ini-
tialized, XtGetResourceList returns a merged resource list that contains the resources for all superclasses. The list returned by XtGet-
ResourceList should be freed using XtFree when it is no longer needed.
If XtGetConstraintResourceList is called before the widget class is initialized (that is, before the first widget of that class has been
created), XtGetConstraintResourceList returns the resource list as specified in the widget class Constraint part record. If it is called
after the widget class has been initialized, XtGetConstraintResourceList returns a merged resource list that contains the Constraint
resources for all superclasses. If the specified class is not a subclass of constraintWidgetClass, *resources_return is set to NULL and
*num_resources_return is set to zero. The list returned by XtGetConstraintResourceList should be freed using XtFree when it is no longer
needed.
SEE ALSO
XtGetSubresources(3Xt), XtOffset(3Xt)
X Toolkit Intrinsics - C Language Interface
Xlib - C Language X Interface
X Version 11 libXt 1.0.5 XtGetResourceList(3)