Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

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

Status
Not open for further replies.

Benali.2

Programmer
Oct 2, 2021
7
0
0
US
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!
 
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?
 
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.
 
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.
 
Thanks, XWb!
Can you share a link to download a free version of Fortran and C++?
 
Windows, Linux, Mac or something else?

Do a search for gcc or gfortran. If you want an IDE try VSCode.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top