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.

ptable1.png

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.

ptable2.png

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

About Primezero

Primezero Research and Innovation is an engineering and semantics workshop, specializing in product development and rapid prototyping since 1996.

Primezero develops online learning tools for math, science, Mandarin Chinese teachers, as well as software for bloggers.

Major projects include: Arizona AIMS Mathematics Test Preparation Web Site for teachers and students, Primezero Chinese Tools 2008, and pzphp (open source toolsets) on Google Code, Chinese Seal Chop Widget for WordPress, Chinese Seal Chop Google Gadget, etc, etc, etc...

For more projects, see the Primezero Portfolio.

Post a Comment