By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,178 Members | 987 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,178 IT Pros & Developers. It's quick & easy.

Comparing and editing columns between two text files

P: 1

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.

Jul 28 '08 #1
Share this Question
Share on Google+
2 Replies

Expert Mod 2.5K+
P: 3,503
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.


Jul 29 '08 #2

Expert 2.5K+
P: 4,059
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.

Jul 29 '08 #3

Post your reply

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