Converting Periodic Table Text File To Tab-Delimited Text File
December 12, 2007 – 6:26 am
I need a tab-delimited file of the periodic table, but all I could find out there is this:
ftp://ftp.nist.gov/pub/dataplot/other/reference/PERIODIC.TXT
So, I guess it is time to use some text-processing techniques to get what I need. These are not tabs you see; these are spaces but nothing consistent.

Let us replace the white spaces between 2 and (let’s say) 20 spaces with exactly 1 tab.
FIND: \s{2,20}
REPLACE: \t
This is your result.

Done.
Developer Notes:
- Pre-processing a file with ereg_replace( ) when I encounter this data format could help
- Accenting elements of the blog post with custom styles helps find important information faster
- New class for science data processing may be useful


