467,081 Members | 1,143 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,081 developers. It's quick & easy.

Comparing and editing columns between two text files

Hi,

I have two text files, with coordinate data organized row by row (for each coordinate of a particle). The data looks like this, for one of the files:

1.9500, 1, 200000.0, 0.0700, 1.7901, 1.7901, 0.0000, 2.00
1, 82.000, -1.515, 233.262, 182.400,184.000, 1.000, 0.426, 0.274, 0.280
2, 87.000, 2.003, 247.324, 203.600,172.600, 1.000, 0.258, 0.081, 0.091
3, 85.500, 11.034, 111.973, 174.500,182.600, 1.000, 0.291, 0.181, 0.167

I need to extract the last column of each file (eg. 0.280, 0.091, 0.167 etc) and compare each row value with the corresponding row in the other file, find which is larger and put it into a new file. How can I do this?

Please help, as I need to find this ASAP for a research project.

Thanks.
Jul 28 '08 #1
  • viewed: 909
Share:
2 Replies
numberwhun
Expert Mod 2GB
Well, what have you tried thus far? If this is as urgent as you say, then I assume you have been coding and trying to perform this operation as you described.

Why not post your code here, enclosed in code tags, and we will help you.

If you haven't done any coding (which would surprise me considering your urgency), then I would suggest you look into using something like the split() function to get each line into an array and then grab the last element of each.

Regards,

Jeff
Jul 29 '08 #2
KevinADC
Expert 2GB
He posted on at least two forums. I gave him a suggestion on devshed but so far no response back wether it helped or not.

devshed
Jul 29 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by sam.collett@gmail.com | last post: by
2 posts views Thread by Martin Hazell | last post: by
8 posts views Thread by Sam Collett | last post: by
1 post views Thread by AmitKu | last post: by
reply views Thread by Frnak McKenney | last post: by
3 posts views Thread by erbrose | last post: by
reply views Thread by Gabriel Genellina | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.