I need help in my code. I have an input file like this:
...goes on..
I would like to take each field into specific arrays and then I will make analysis of them but even I could not extract them into separate arrays properly. Here I wrote a very simple code but i couldnt get the output I want;
Then it gives the output;
which seems correct but it did not give all the values, it stopped somewhere in the middle. In my case; I have more lines in my input than I posted here. For example, I have 40 lines in my actual input, and in the output I got half of them...
I will have to compare each value in rssi array with each other in the future. For example, if there is a change it will give the changed values. In this case, i posted above, it would be like;
only changed values.
Also i would like to do all these things only in one script. Is it possible to do it with awk because i am only familiar with awk and i am a starter.
Any help will be appreciated.
Thank you so much.
Last edited by vgersh99; 10-22-2010 at 08:53 AM..
Reason: code tags, please!
Hi there, Im sure there is a simple explanation for this but I have a file like this with no balnk lines
peter
paul
john
I run the command
# var=`grep paul file.txt`
# echo $var
paul
# echo $var | wc -l
1
but when I grep for a value that isnt in the file, i still... (4 Replies)
Hi All,
I'm having a problem when I run the following code for example
perl -e 'use LWP::Simple; getprint "http://google.com"'
Can't locate LWP/Simple.pm in @INC (@INC contains: /System/Library/Perl/5.8.6/darwin-thread-multi-2level /System/Library/Perl/5.8.6... (7 Replies)
Hi, I have a very simple script like below:
for n in 10 20 30
do
for a in 30 40 50 60 70 80
do
for r in 2 3 4 5 6 7
do
m=$((r*a))
count=1
while
do
echo "a = " $a ", m = " $m ", n = " $n
... (2 Replies)
I'm trying to port some code over to unix Solaris. I'm not really a unix programmer so I'm sure this is something straight-forwards but I'm getting the following:
> g++ -c CTrade.cpp
In file included from CTrade.cpp:1:
stdafx.h:6: warning: `#pragma once' is obsolete
CTrade.cpp:4: iostream: No... (1 Reply)
I have this little program ...
int main(void){
printf("Before");
fork();
printf("After");
}
output is this.....
BeforeAfterBeforeAfter
Shouldnt it be.....BeforeAfterAfter
After parent is forked child receives the copy of program and continues from next statement... (3 Replies)
hi,
I'm a newbie to shell scripting. I wanted to initialise an array using basic for loop and read it.
Then i want to print it as a .CSV file..
Any help would me much appreciated.. (1 Reply)
Hi all,
Simple question, how can I simply create an array from listing the files in a directory i..e
myvar=`ls`;
echo $myvar gives a fulllist of files/ directories
how can I now convery myvar to an array so I can loop around and read each file/dir?
Thnaks
CF:) (6 Replies)
Ksh Scripting
Can some one give me a simple example of array operations using ksh.
For Ex:
week_array = {Sunday Monday Tuesday Wednesday Thursday Friday Saturday}
I want to assign and retrieve and print them along with their index.
I am looking for the o/p like:
0 Sunday
1 Monday ... (2 Replies)
Hi, I'm a newer for this languages, and I have a log file, which is something like this:
35.75.253.207 - - "GET /products/orgonizer/title.png HTTP/1.1" 200 1555 "-" "Mozilla 1.4"
Now, I want to write a shell code to accoplish like ./XXX.sh -N n
n is a number by user input, the code should... (5 Replies)
Hi,
I have successfully setup my Samba server on my Sun Solaris 8 Sparc machine. My Win2000 workstation is able to see the unix worstation and its shared directory from Network Neighborhood.
However, the Unix workstation appears as Ip address instead of Hostname on my network neighborhood... (5 Replies)