05-12-2013
Hi,
i am extremely sorry. I get the same output as you got for the data i pasted. But when i run for actual data , it takes all averages for all timesteps. The actual data which looks like this :
HTML Code:
SOURCE: TIMESTEP
1
SOURCE: NUMBER OF SERIES
594
ITEM: SHAPE CONSTRAIN pp pp pp
-10 30
-10 30
-10 30
ITEM: SERIES id type x y z
300 1 -0.018638 -2.55234 -6.32752
100 1 1.41254 -2.58375 -6.49904
200 1 -2.83075 0.0568085 -6.31853
100 1 -2.13227 -1.15906 -6.22779
200 1 -0.72638 -1.26406 -6.59486
300 1 0.0490859 0.005266 -6.90442
SOURCE: TIMESTEP
2
SOURCE: NUMBER OF SERIES
594
ITEM: SHAPE CONSTRAIN pp pp pp
-10 30
-10 30
-10 30
ITEM: SERIES id type x y z
100 1 -0.458893 -1.85236 -6.76382
200 1 2.44809 -1.75353 -6.94784
300 1 1.69774 -0.511574 -6.93282
300 1 -2.26969 -5.05726 -4.42174
200 1 0.629752 -5.01888 -4.87928
100 1 2.07906 -4.80346 -4.90814
Issue : When i run the script for this, it takes average of X,Y,Z for all the timestep. I would be really thankful, if I get separate X,Y,Z averages for corresponding TIMESTEPs.
And i do not want this get displayed in the output:
HTML Code:
SOURCE: NUMBER OF SERIES
594
ITEM: SHAPE CONSTRAIN pp pp pp
-10 30
-10 30
-10 30
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Everyone,
Please help me with this. I have gone through many posts here but couldn't find what I wanted.
I have a file with 79000+ lines and I want to delete lines in a pattern.
I want to delete every 141st line in the file, starting from line 2000 till 50000.
Please help guys.
... (8 Replies)
Discussion started by: max29583
8 Replies
2. UNIX for Dummies Questions & Answers
I have below file say temp1
BSCAJM1:HWJA10C
BSCAJM1:
BSCALW1:
BSCALW1:GVND01B
BSCALW1:
BSCALW1:
BSCBKNR:IJNMKTA
BSCBKNR:
BSCJOD1:
BSCJOD1:JOD121B
i want to delete all the lines ending with : and have below output
BSCAJM1:HWJA10C
BSCALW1:GVND01B
BSCBKNR:IJNMKTA... (8 Replies)
Discussion started by: lalchand
8 Replies
3. Shell Programming and Scripting
Hi All ,
Given a file , I need to delete , modify and insert lines matching certain patterns in that file using shell scripting.
e.g. If a file FILE1 has following content :
CUST.ABC.DEF = CUST.ABC.DEF * CUST.ABC.DEF
PRINTF(CUST.ABC.DEF)
CUST.ABC.DEF = mid(CUST.ABC.DEF,10.34)... (5 Replies)
Discussion started by: swapnil.nawale
5 Replies
4. Shell Programming and Scripting
Say I used grep and awk for taking text out of a text file...
I now /have 3 lines of text that I want to combine to make 1 line.
What command could I use to do this?
...
display line 1 twice then
sed s/$line1/$line2/ ????... display line 2 twice then
sed s/$line2/$line3/ (2 Replies)
Discussion started by: puttster
2 Replies
5. Shell Programming and Scripting
Hi i need an help. I have two files list1 and list2, both contains the server names i want to delete the servers in list2 which were also found in list1.
for an eg
list2 list1
oradg1 oradg4
oradg2 oradg2
oradg3 ... (5 Replies)
Discussion started by: sudharson
5 Replies
6. Shell Programming and Scripting
Hi,
I have a file with more than 2,000 rows like this:
05/26/2011,1200,1500
I would like to create a awk shell script that calculate the price average of the second and third field each 5,10 and 20 rows or ask me for the values, starting at first row.
Finally compare the average value... (1 Reply)
Discussion started by: csierra
1 Replies
7. Shell Programming and Scripting
Hello,
I am trying to create a awk script to calculate the simple moving average of two fields but I got only the result of the first field.
Could you please help me to fix this awk shell script
awk -F, -v points=5 '
{
a = $2;
b = $3;
if(NR>=points) {
total_a = 0;
total_b... (1 Reply)
Discussion started by: csierra
1 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I have a space delimited text file that looks like the following:
Aa 100 200
Bb 300 100
Cc X 500
Dd 600 X
Basically, I want to take the average of columns 2 and 3 and print it in column 4. However if there is an X in either column 2 or 3, I want to print the non-X value. Therefore... (11 Replies)
Discussion started by: evelibertine
11 Replies
9. How to Post in the The UNIX and Linux Forums
I have date file like below..
1995 1 2 10 29 38.6706 -6.53823 41.9201
1995 1 2 10 29 -49.2477 -4.59733 17.2704
1995 1 2 10 29 -49.2369 -4.48045 8.61348
1995 1 3 8 48 -42.2643 ... (3 Replies)
Discussion started by: athithi
3 Replies
10. Shell Programming and Scripting
Hello all,
I have a large csv file where there are four types of rows I need to merge into one row per person, where there is a column for each possible code / type of row, even if that code/row isn't there for that person.
In the csv, a person may be listed from one to four times... (9 Replies)
Discussion started by: RalphNY
9 Replies
LEARN ABOUT DEBIAN
cgi::extratags
Extratags(3pm) User Contributed Perl Documentation Extratags(3pm)
NAME
CGI::Extratags - Useful Extensions for the CGI Module
SYNOPSIS
use CGI::Extratags;
$cgi = new CGI::Extratags;
print $cgi -> email ('racke@linuxia.de');
print $cgi -> jump ('CONTACT', 'contact us');
print $cgi -> mark ('CONTACT', $cgi -> h2 ('How to contact us'));
print $cgi -> row ('Date', 18, 1, 1966);
print $cgi -> recall ('Debian CD', artnum => '0-123456');
DESCRIPTION
CGI::Extratags adds several useful methods to the CGI class.
email ADDRESS
print $cgi -> email ('racke@linuxia.de');
Produces HTML code for a link to an email ADDRESS.
jump MARK TEXT
print $cgi -> jump ('CONTACT', 'contact us');
Produces HTML code for a link pointing to a target within the current document.
mark NAME TEXT
print $cgi -> mark ('CONTACT', $cgi -> h2 ('How to contact us'));
Generates target NAME for hyperlinks.
row [ITEM ...]
print $cgi -> row ('Date', 18, 1, 1966);
Produces HTML code for a table row with ITEM arguments as cell contents.
recall TEXT [NAME [VALUE]] ...
foreach my $num (sort (keys %artmap))
{
print $cgi -> recall ($artmap{$num}, artnum => $num);
print $cgi -> br;
}
Produces a link to the script itself labeled with TEXT. The NAME/VALUE pairs will be passed as parameters.
AUTHOR
Stefan Hornburg, racke@linuxia.de
SEE ALSO
perl(1), URI::Escape(3), CGI(3).
perl v5.8.4 2004-07-11 Extratags(3pm)