[CLUE-Tech] Simpler way of parsing data

Kevin Cullis kevincu at orci.com
Sat Apr 14 23:43:37 MDT 2001


Hey all,

I've been having a discussion with a programmer friend of mine and it's
funny how we both have different views of the same problem.  I sometimes
want to "cut and paste" data from the web browser into VIM in order to
parse the data into useable form, such as records to be inported into a
database. However, he has stated, along with other programmers I know,
that I should save the file in HTML and then parse the HTML out of the
file.  However, while both achieve the same results, my programming
friends way takes considerably more work and knowledge than my "cut and
paste" method.  In fact, all I have in my file is the data with a large
number of spaces which require ONLY one command to use in order to
remove the multiple spaces rather than his PERL or other method to
parsing HTML tags.

Why am I mentioning this?  Because most new people to Linux can be
bombarded with more technical approaches to a problem when sometimes a
simple problem requires a simple solution.

In VIM, I type:

:%s/   *//g

to remove all multiple spaces leaving only my data in fields.  However,
my friends approach can be used for more complex approaches to other
problems which I can consider in future projects.

Just a comment.

Kevin



More information about the clue-tech mailing list