Skip to content

Instantly share code, notes, and snippets.

@conartist6
Forked from anonymous/example.c
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save conartist6/9455599 to your computer and use it in GitHub Desktop.
Save conartist6/9455599 to your computer and use it in GitHub Desktop.
struct star {
float BTmag,
float VTmag,
int Plx,
int Plx_err
}
void main() {
const char *source_holder = "H| 1| |00 00 00.22|+01 05 20.4| 9.10| |H|000.00091185|+01.08901332| | 3.54| -5.20| -1.88| 1.32| 0.74| 1.39| 1.36| 0.81| 0.32|-0.07|-0.11|-0.24| 0.09|-0.01| 0.10|-0.01| 0.01| 0.34| 0| 0.74| 1| 9.643|0.020| 9.130|0.019| | 0.482|0.025|T|0.55|0.03|L| | 9.2043|0.0020|0.017| 87| | 9.17| 9.24| | | | | | | | 1| | | | | | | | | |S| | |224700|B+00 5077 | | |0.66|F5 |S ";
struct star hp;
sscanf(source_holder, "%c|%*12d|%*c|%*2d %*2d %*5f|%*3d %*2d %*4f|%5f|%*1d|%*c|%12f|%*12f|%*c|%*7f|%*8f|%*8f|%*6f|%*6f|%*6f|%*6f|%*6f|%*5f|%*5f|%*5f|%*5f|%*5f|%*5f|%*5f|%*5f|%*5f|%*5f|%3d|%*5f|%6d|%*6f|%*5f|%*6f|%*5f|%*c|%*6f|%*5f|%*c|%*4f|%*4f|%*c|%*c|%*7f|%*6f|%*5f|%*3d|%*c|%*5f|%*5f|%*7f|%*c|%*1d|%*c|%*5d%*5d|%*c|%*2d|%*2d|%*c|%*c|%*c|%*2c|%*3c|%*7c|%*5c|%*5c|%*4c|%*c|%*c|%*c|%*6d|%*c%*3d %*5d|%*c%*3d %*5d|%*c%*3d %*5d|%*4f|%*12c|%*c ",
&hp.BTmag, &hp.VTmag, &hp.Plx, &hp.Plx_err);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment