09-15-2008
You'll need to create a counter $count
While $lineArray[4] (your number of elements), is less than $count, you'll loop through creating the new array of (element0start:element0end element1start:element1end etc.)
Then increment the counter so that you don't continue trying to create new elements in the new array after you've mapped the sets
10 More Discussions You Might Find Interesting
1. Programming
hello,
is there a utility to determine which object files are used to create a binary executable file?let me explain, please:
for ex. there are three files:
a.o b.o c.o
and these files are used to create a binary called:
prg
namely, a.o b.o c.o -> prg
so, how can i determine these three... (1 Reply)
Discussion started by: xyzt
1 Replies
2. Shell Programming and Scripting
So I have two files that I want to put together via hashes and am having a terrible time with syntax. For example:
File1
A apple
B banana
C citrusFile2
A red
B yellow
C orangeWhat I want to enter on the command line is:
program.pl File1 File2And have the result... (11 Replies)
Discussion started by: silkiechicken
11 Replies
3. Shell Programming and Scripting
Hi folks,
I have a structure as mentioned below in a configuration file.
<Component>
Comp1:
{
item1:data,someUniqueAttribute;
item2:data,someUniqueAttribute,
}
Comp2:
{
item3:data,someUniqueAttribute;
... (1 Reply)
Discussion started by: ckv84
1 Replies
4. UNIX for Dummies Questions & Answers
Hello,
I have a flat file with a list of files with the path to the file and I am attempting to calculate the filesize for each one; however xargs isn't playing nicely and I am sure there is probably a better way of doing this.
What I envisioned is this:
cat filename|xargs -i ls -l {} |awk... (4 Replies)
Discussion started by: joe8mofo
4 Replies
5. Shell Programming and Scripting
Hi everyone
I am very new at awk and to me the task I need to get done is very very challenging... Nevertheless, after admiring how fast and elegant issues are being solved here I am sure this is my best chance.
I have a 2D data file (input file is a plain tab-delimited text file). The first... (1 Reply)
Discussion started by: stonemonkey
1 Replies
6. Shell Programming and Scripting
Hi,
I have an hashes of hash, where hash is dynamic, it can be n number of hash. i need to compare data_count values of all .
my %result (
$abc => {
'data_count' => '10',
'ID' => 'ABC122',
}
$def => {
'data_count' => '20',
'ID' => 'defASe',
... (1 Reply)
Discussion started by: asak
1 Replies
7. Red Hat
I'm using CentOS 6.3 and I use a crontab entries like this:
0 23 2-31 * 1-6 root weekdayscript
0 23 1 * 7 root weekendscript
this 2 entries always overlaps... but I don't know how... :wall:
thanks (10 Replies)
Discussion started by: ionral
10 Replies
8. Shell Programming and Scripting
Hi!
I just want to count number of files in a directory, and write to new text file, with number of files and their name
output should look like this,,
assume that below one is a new file created by script
Number of files in directory = 25
1. a.txt
2. abc.txt
3. asd.dat... (20 Replies)
Discussion started by: Akshay Hegde
20 Replies
9. Solaris
Hello to all,
what is the command in Solaris/Unix which I can use to determine how many hard disks exist in the system?
I have tried with different command such as df -lk and similar but cannot know for sure how many actual disks are installed.
Commands like # fdisk -l | grep Disk and #... (14 Replies)
Discussion started by: Mick
14 Replies
10. Shell Programming and Scripting
hi,
problem:
output is not consistent as expected using external command in AWK
description:
I'm trying to convert $2 into a base64 string for later decoding, and for this when I use awk , I'm getting overlapped results , or say it results are not 100% correct.
my code is:
gawk... (9 Replies)
Discussion started by: busyboy
9 Replies