By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,852 Members | 1,410 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,852 IT Pros & Developers. It's quick & easy.

Laundry list

P: 1
I apologize for the long background story, but my project is a tad esoteric.

Technical data on individual stars are difficult to find, and what searchable databases I've found are geared more towards astronomers than lay people. At the same time, large catalogues of stars are freely available on the web as text files.

My project involves two scripts. The first script will mine the data out of these text files, generate some derived data like a 3D Cartesian coordinate (x, y, z), and combine it all into one (probably CSV) text file. The second script, naturally, will be a script to search the combined file based on user-provided criteria. I will also be setting up several presets for search criteria, such as for particularly Sun-like stars. The catch is that my programming skills are very rudimentary.

At the moment, what I have is a script that converts one of the files into CSV (the original format being character columns, e.g. column 1--4 is the catalog ID number, column 5--10 the type, etc.), a second script that does the mining and generation of the "combined file", and a script that lets the user input the ID number of a star, a distance, and "1" if they want to filter for Sun-like stars, and generates an unsorted file with all (or just Sun-like) stars within the specified distance of the target.

One big gap in my knowledge is efficient search methods, both for the search script itself and when building the combined file (checking to see if a given star is already in the combined file). Another is how to insert a new line to a file without having to rewrite the entire file (also for adding additional catalogue data to the combined file). A third, somewhat related, gap is how to sort the output from searches. Finally, I suspect there's a way to process the original files directly, without having to convert them all to CSV first (the main problem being how to handle the whitespace used to make the columns neat).

I've done some googling, but haven't found anything online (I recently moved to Argentina, so I can't just go out and buy a book), so I'm asking as much for pointers to tutorials and instructions as I am direct suggestions on how to do things.

Thanks in advance for your help.
Jan 12 '08 #1
Share this Question
Share on Google+
2 Replies


eWish
Expert 100+
P: 971
Have you considered using a database for this? It would be you most efficient and practical solution. Using a database would make searching simple. You would just need to parse the text files to get the data you want to store. Then insert it into a well structured database.

--Kevin
Jan 12 '08 #2

KevinADC
Expert 2.5K+
P: 4,059
Really, I have to agree. What you want to learn is SQL, and probably MySQL in specific. Then if you want to use perl as the interface between the user and the database you will use the DBI module along with the appropriate databse driver, DBD::mysql for example.

But, it could be done with text files if you really want to go that route.
Jan 12 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.