Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Convert Excel database or text file to BiBTeX?

5,374 views
Skip to first unread message

David Pearson

unread,
May 2, 2002, 7:22:31 AM5/2/02
to
Dear list,

I have been cataloging my papers in an Excel spreadsheet,
but I would now like to make this database available
to BiBTeX.

I can think of a bad way of doing it: insert columns
between the existing columns of the spreadsheet, containing
strings that would not normally be encountered
(such as QZQZQ, XCVBVCX , etc.), then output the
spreadsheet as a text file. Then change the weird
strings to BiBTeX format commands using sed or just
any old text editor.

But this is slow and cumbersome, and I would not like
to have to do each time I update my Excel database.

I would be grateful for any advice on a better way
of doing it.

Regards,
David Pearson.


--
David Pearson, Phone: +44 (0)118 9318741
ESSC, Fax: +44 (0)118 9316413
University of Reading, Email: dw...@mail.nerc-essc.ac.uk
Reading RG6 6AL,
UK. www.nerc-essc.ac.uk/~dwcp/Home.html

Wald

unread,
May 2, 2002, 9:45:26 AM5/2/02
to
Why would you use Excel as a bibliographic database ?

Anyway, I'd export the sheet to a text-like file (comma delimited or
something), and write a (perl) script to make the necessary adjustments...

Greetings,
Wald


"David Pearson" <david....@mail.nerc-essc.ac.uk> wrote in message
news:3CD12177...@mail.nerc-essc.ac.uk...

Norman Gray

unread,
May 2, 2002, 8:50:43 AM5/2/02
to
Greetings,

David Pearson <david....@mail.nerc-essc.ac.uk> writes:

>I have been cataloging my papers in an Excel spreadsheet,
>but I would now like to make this database available
>to BiBTeX.

>I can think of a bad way of doing it:

Oooh, that's putting it mildly!

>[...] insert columns


>between the existing columns of the spreadsheet, containing
>strings that would not normally be encountered
>(such as QZQZQ, XCVBVCX , etc.), then output the
>spreadsheet as a text file. Then change the weird
>strings to BiBTeX format commands using sed or just
>any old text editor.

Dumping the spreadsheet as CSV (semicolons or tabs, say), and charging
through it with awk ('awk -F; '{printf "field=%s\n", $3}', say, prints
out the third field separated by `;') or Perl would be a much better
idea:

while (<STDIN>) { # read a line from std. input, into variable $_
@line = split (';'); # split $_ at `;', into array @line
print "@article{$line[0],\nauthor={$line[3]}\n}\n"; # print it
}

or something like that.

All the best,

Norman

--
---------------------------------------------------------------------------
Norman Gray http://www.astro.gla.ac.uk/users/norman/

Lucian Wischik

unread,
May 2, 2002, 10:33:51 AM5/2/02
to
David Pearson <david....@mail.nerc-essc.ac.uk> wrote:
>I can think of a bad way of doing it: insert columns
>between the existing columns of the spreadsheet, containing
>strings that would not normally be encountered
>(such as QZQZQ, XCVBVCX , etc.), then output the
>spreadsheet as a text file. Then change the weird
>strings to BiBTeX format commands using sed or just
>any old text editor.

Sounds fine to me. Except you might as well store the strings as they'll
actually appear: "@Article{" in one column, "author=" in another column,
"}" in another column. Then export it as text.

Actually, there's another neater way. Suppose you have your excel table
like this:
msp82 Milner The Pi Calculus
ws01 Wischik Explicit Fusion Machine
then you could make a fourth column to the right of these with the formula
="@Article{"&A1&", author="""&B1&""", title="""&C1&"""}"
Then simply select this right hand column, and paste it into a text file,
and Hey Presto! you have your bibtex without the need for any intermediate
programs.

You could also wrap the formula up in
SE(A1="";"";...)
so that it remains blank unless the keyword was present. (PS. SE is what
they call the function in the Italian version I'm using. I guess it's just
IF in english.)

--
Lucian Wischik, Queens' College, Cambridge CB3 9ET. www.wischik.com/lu

Arthur Berkowicz

unread,
May 3, 2002, 11:01:45 AM5/3/02
to

"David Pearson" <david....@mail.nerc-essc.ac.uk> skrev i en meddelelse
news:3CD12177...@mail.nerc-essc.ac.uk...

> Dear list,
>
> I have been cataloging my papers in an Excel spreadsheet,
> but I would now like to make this database available
> to BiBTeX.
>
A ralatively simple Excel/VBA-macro could quite easily handle it.

Arthur


0 new messages