That's a nice code Kevin... This is working. The next step is to get it counting for n times it is getting the same X Y Z colums.
example
1 2 3
4 5 6
1 2 3
8 9 10
5 4 3
I wanna get this:
1 2 3
1 2 3
4 5 6
5 4 3
8 9 10
and:
1 2 3 is 2 times found
4 5 6 is 1 time
5 4 3 is 1 time
8 9 10 is 1...
Hello guys. Does anybody know how to order ascendent a list of data?
What i mean is that i got 3 columns of data. What i need is to order them with respect to the first one, but i need all the 2 next colums get order at the same time that one.
Example
1 5 4
4 8 9
10 15 4
1 5 8
2 7 9
so...
#!/usr/bin/perl -w
use strict;
my $number = 1;
open FH, ">$number.dat" or die "Failed to open file [$number.dat]";
while(<DATA>) {
if(/^(?:OCHO)?\s*$/) {
close FH;
$number++;
open FH, ">$number.dat" or die "Failed to open file [$number.dat]";
next;
}
print FH "<"...
Thanks guys but what i'm needing is to rename 600 files whose names r 1.dat, 2.dat...10.dat, 11.dat...600.dat To
001.dat, 002.dat,003.dat...010.dat etc
that's because when i use another program i need to get named on that way.
So any advice
another question trojan.
I have another post in here about distance between 2 points.
Do u think using ur code can be easy to do that calculation?.
I gonna give it a try but i need ur opinion.
Hello there trojan.
You did it the next code and that is working but i got a new question.
*********************
#!/usr/bin/perl -w
use strict;
my $number = 1;
open FH, ">$number.dat" or die "Failed to open file [$number.dat]";
while(<DATA>) {
if(/^(?:OCHO)?\s*$/) {
close FH...
Hello again.
What i really want to get is comparations between all the points, same way ur last code did it.
but i need to print the kind of colors for example, just to know if i'm comparing red with red and red with green. That's because when i print those to a file i want to identify them...
Hello rharsh.
ok ur code is working...now i got another question.
In the last code u can know distances for 1 data set of 8 rows right?
What should i do to be able to do the same for more than 1 data block ?
Example:
1 0.266E+01 0.229E+01 0.384E+01
2 0.383E+01 0.301E+01 0.264E+01
1...
...another program that need that secuence to read files better.
Any advice?
That's just in the print statement.
How i need to modify next file?
*****************************************
open (INFILE, $infile);
my $number = 1;
open FH, ">$output_directory/$number.dat" or die "No puedo...
...blocks of 3 rows or more, and i need to print that information of each block to a file
example first block to 1.dat
second block to 2.dat, etc
********************************
#!/usr/bin/perl -w
#use strict;
my @points = map {[split]} <DATA>;
my $min_dist = 10...
...fortran i did 2 nested cycles and i put a conditional to do that.
that is a kind of:
for 10 i=1,nrows
for 20 j=1, nrows-1
distance(i,j)= square(x**2+y**2+z**2)
if (distance(i,j).LE.VALUE) then
print (*,30) value
20 continue
30 format(f10.3)
10 continue
I meant, it's necesary to compare...
...to read this 2 point ( row number one and row number 2) and calculate the distance between them using the next expression:
d=square root( (x2-x1)**2 +(y2-y1)**2 +(z2-z1)**2 )
Think about a lot of rows and a lot of comparations
for example:
point1 ----------point2------point3
i need to...
Hello.
I answered a part of my confusion. I got another question to u.
I'm trying to print double quotes . So how can I print to my file this kind of phrase?
#include "background.inc"
i tried
print FH "#include" qq("background.inc"\n)
I meant i want to print double quotes .
Thanks in...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.