×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Use a txt file (X, Y, Z), with random values for X and Y, to get a new file X and Y are predefined

Use a txt file (X, Y, Z), with random values for X and Y, to get a new file X and Y are predefined

Use a txt file (X, Y, Z), with random values for X and Y, to get a new file X and Y are predefined

(OP)
Anyone with experience with Fortran or C++. I have a big 3D geometric txt file (X, Y, Z), about 50k lines, but it's not perfectly structured, I mean X and Y are picked at random. I want to create a new file based on the data of the first file, where the values of X and Y are predefined, so the program calculates the new values of Z, and then the program creates a new text file. Please share a link to download a free simple version of Fortran or C++. Since about 2017, I have not used both languages.
Thanks in advance!

RE: Use a txt file (X, Y, Z), with random values for X and Y, to get a new file X and Y are predefined

Why not just sort the file into unique X, Y values and then read them in and generate your Z values?

Don't really understand what the problem is. Are you asking a C++ or Fortran problem?

RE: Use a txt file (X, Y, Z), with random values for X and Y, to get a new file X and Y are predefined

(OP)
I need how to write a simple Fortran or C++ program to read a txt file of 3 columns (x, y, z) and about 50 thousand lines to create a new 3 column text file (x, y, z) with x and y predefined.

RE: Use a txt file (X, Y, Z), with random values for X and Y, to get a new file X and Y are predefined

So just write it and if you hit problems that you can't figure out, post the code and tell us what errors you are getting.

RE: Use a txt file (X, Y, Z), with random values for X and Y, to get a new file X and Y are predefined

(OP)
Thanks, XWb!
Can you share a link to download a free version of Fortran and C++?

RE: Use a txt file (X, Y, Z), with random values for X and Y, to get a new file X and Y are predefined

Windows, Linux, Mac or something else?

Do a search for gcc or gfortran. If you want an IDE try VSCode.

RE: Use a txt file (X, Y, Z), with random values for X and Y, to get a new file X and Y are predefined

(OP)
thank you XWB!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close