hi everyone,
how are you! i need a c program to read a Segy format file. i hope that the program can output the trace header and seismic data information in ASCII format, who can help me ? Thank you very much!

What code have you written so far ?

#include "stdio.h" 
main() 
{ 

FILE *IN,*OUT; 
short V3200[3200];
int V400[400];
int   H60[60];
float Data[1000];

IN=fopen("PRD99993DJILIN.segy","rb"); 
 
fread(V3200,sizeof(short),3200/sizeof(short),IN);
fread(V400,sizeof(short),12,IN);
fread(H60,sizeof(int),240/sizeof(int),IN);
fread(Data,4,1000,IN); 

fclose(IN); 
}

this is my c program to read segy format data. IN array H60[60] and Data[1000], the value is not my expected value.

"This directory contains the source code and shell scripts necessary to convert SEGY files to ASCII format and to create postscript plots, along with a makefile and a README file."

I found that with an obvious web search.
Is it what you want?
Can you guess what I typed?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.