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...
Hello there guys.
I got a big problem here.
When I get output files these r called for example
1.dat
2.dat
3.dat
..
10.dat
...
600.dat
What i need is to get numbers like:
001.dat
002.dat
...
600.dat
this in the case i got 600 files, I think that when i"ll get
1000 files or more , this new...
I use ur code and i get something like that:
How could i avoid to get a lot of lines without sense?
Now imagine that u get blocks of data like
123
456
789
10 11 12
13 14 15
16 17 18
I meant, blocks of 3 rows or more, and i need to print that information of each block to a file
example first...
Hello again. I'm really expecting 200 rows to be compared.
In 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...
Hello guys.
I got a file and it has numbers on rows
x1 y1 z1
x2 y2 z2
what i need is 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...
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.