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 Mike Lewis 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 4

Status
Not open for further replies.

Benali.2

Programmer
Oct 2, 2021
7
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!
 
I have experience with 3D geometry, but I don't understand your question. Can you post your file as an attachment?

Also, Visual Studio 2017, 2019, and Preview 2022 are available for free use by individual developers or for small companies up to five developers. It will handle C++. I don't have a Fortran compiler.

--
Rick C. Hodgin
 
Just about any Linux distro will let you install, for free, the GNU C, C++ and Fortran compilers.
 
Thank you @Rick and @Sam!
This is what I was looking for, as shown in the attached photo, I think MATLAB can do that!
I also downloaded Visual Studio and Simply fortran 3
Arrays_question_ozy76v.png
 
I understand the file format and can see the fileA.txt data. It's X,Y,Z coordinates. But, in looking at the fileB.txt output file, I don't understand how you want to process it to get that format.

--
Rick C. Hodgin
 
its is 3 dimensional two array consisting of 50 rows and three columns use a c++ program code pro zone take each element from respective column and row and perform operation.
 
So what have you done so far? What sort of problems are you experiencing in writing your code? What are you getting and what are you expecting? Presumably you just want to get the numbers and are using some package to draw the graphs.
 
Hi guys,

In a simple way, I needed a 3D structure structured in a txt file (fileB) based on an unstructured 3D structure in a txt file also (fileA).
The easy way to get this is to create a program that interpolates between every two points like A_i (x1_i, y1_i, z1_i) and A_i + 1 (x1_i + 1, y1_i + 1, z1_i + 1) using Bi(x2_i, y2_i) to find the Z of Bi (x2_i, y2_i, Z2_i)
We have all values of x1, y1, z1, x2, y2, and the only value needed is Z2_i!
By the way, we solved this problem using Matlab. Any idea to use C++ would be greatly appreciated!

Benali
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top