Thanks Mac!
I seem understanding more of your code now, but not quite sure the exact algorithm. As a learner, I'd like to confirm your logic flow with my comment for the tricky part. If this is too novice to reply, just ignore my post, although I hope to get your correction if I mis-understand it.
Thanks a lot!
# Get the file to the array @file_list
# split each row the $id and get the $count
# If the $id is NOT defined, define it!
#This is the hash of hash right? using $id as the key for the first layer of hash and $name as key for the second layer. This part is tricky to me.
#But why the second layer of the hash need not be declared at the beginning?
# Use the hash of hash to get the value of the second layer of hash, right?
#sort is not neccessary right?
If my understanding is correct, I have made progress about the data structure with perl. Thanks a lot again!
Thanks Mac!
I seem understanding more of your code now, but not quite sure the exact algorithm. As a learner, I'd like to confirm your logic flow with my comment for the tricky part. If this is too novice to reply, just ignore my post, although I hope to get your correction if I mis-understand it.
Thanks a lot!
# Get the file to the array @file_list
# split each row the $id and get the $count
# If the $id is NOT defined, define it!
#This is the hash of hash right? using $id as the key for the first layer of hash and $name as key for the second layer. This part is tricky to me.
#But why the second layer of the hash need not be declared at the beginning?
The second layer stores one integer only, not another hash array, so you don't need to initialize it as an empty hash like the first layer.
# Use the hash of hash to get the value of the second layer of hash, right?
Yes.
#sort is not neccessary right?
It is not neccessary, use it or not depends on your output style.
If my understanding is correct, I have made progress about the data structure with perl. Thanks a lot again!
Yifang
This User Gave Thanks to MacMonster For This Post:
Hi Folks -
I'm encountering an issue:
Scenario:
We have automated GL data loads utilizing FDMEE. The problem is that some of our Locations could have multiple files. I think we are running into a situation where the script is trying to name the 2 files the same name and it is bombing out.... (8 Replies)
Hello,
Im using the g++(g++ Ubuntu/Linaro 4.4.4-14ubuntu5 4.4.5) and im trying to compile a small snippet code and got into an endless loop.I recompiled that in VS2010 under Windows 7 and the answer is as expected.so i wonder is this a bug of g++?here is my code.
#include<iostream>
using... (5 Replies)
#!/bin/bash
if then
#echo "infinite loop"
exit 0
fi
when I run this file I get the following error:
./test_infinite_loop: line 5: syntax error near unexpected token `fi'
./test_infinite_loop: line 5: `fi'
:confused: (4 Replies)
This single line of code in a sh script file
top -b -n 1 -U $USER
causes the script to prematurely exit with an exit code of 1 (i.e. an error) if the script is run with the -e option (e.g. if
set -e
is executed near the top of the script file).
Alternatively, you can execute it like
top... (8 Replies)
Hi All,
I am using Red Hat Linux on my servers. The problem that I am facing is, sometimes the /opt usage on the server shows used percentage as 100% , when actually it is simply 20%.
When I reboot the system, it comes back to 20%.Is this a bug in the system or my settings have gone wrong... (1 Reply)
I have done a script and IT WORKS JUST PERFECT from command line...but in cron it has problems executing...
nawk -F"|" '
{ s=substr($104,2,18)}
{b ++s}
END { for (i in b) print i, b } ' $1 > /path/to/files/TranId_w$2
q=`cat /path/to/files/TranId_w$2 | wc -l`
echo $q >... (1 Reply)