[Solved + Issue] Create Writer files from Calc data

Discuss the spreadsheet application
Post Reply
leptserkhan
Posts: 5
Joined: Mon Feb 11, 2013 11:03 pm

[Solved + Issue] Create Writer files from Calc data

Post by leptserkhan »

Hello All,

This is not a mail merge question.

I'm wondering if there is a way to create multiple OpenOffice.org writer files from data contained in a calc file?

For example: column A contains File Name, Column B contains First and Last Name and C contains some text in sentences with carriage returns.

I now need to create as many separate .doc files (yes, need to save the files as .doc files, not .odt files) as there are entries in Column A, and the file names must match the entries in Column A.

I may be wishing on a star here and perhaps OpenOffice cannot do this, but if it can, can a guru give me some clues?

Thanks!
Last edited by RoryOF on Tue Feb 12, 2013 11:14 am, edited 2 times in total.
Reason: Marked as Issue by request of Villeroy
OpenOffice 3.4.1 windows xp
User avatar
Villeroy
Volunteer
Posts: 31365
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Create multiple Writer files from Calc spreadsheet data

Post by Villeroy »

Unless I got something wrong, this is exactly the same as a mail merge and you should definitively use WinWord if the target file format is .doc.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
leptserkhan
Posts: 5
Joined: Mon Feb 11, 2013 11:03 pm

Re: Create multiple Writer files from Calc spreadsheet data

Post by leptserkhan »

It's my understanding that a mail merge will create one file which contains the merged fields as seperate, for example, letters -- but they are all contained in the single file saved on disk. As I stated, I am interested in creating multiple .ods or word files which contains the data contained in the calc spreadsheet. And my apologies -- it can be a writer file does not have to be a .doc file.

Unless I'm missing something, tell me how that is like a mail merge?
OpenOffice 3.4.1 windows xp
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Create multiple Writer files from Calc spreadsheet data

Post by acknak »

When you do the merge, there is an option to produce either one combined output (to printer or document), or you can create a separate document for each merged record. If you merge to separate documents, one of the fields in the data source can be used as the file name (or maybe part of the name?).
AOO4/LO5 • Linux • Fedora 23
User avatar
Villeroy
Volunteer
Posts: 31365
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Create multiple Writer files from Calc spreadsheet data

Post by Villeroy »

acknak wrote:When you do the merge, there is an option to produce either one combined output (to printer or document), or you can create a separate document for each merged record. If you merge to separate documents, one of the fields in the data source can be used as the file name (or maybe part of the name?).
But the result is one Writer document per record which is difficult to convert into a bunch of Word documents. The built-in batch conversion converts .doc to .odt but not the other way round.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
leptserkhan
Posts: 5
Joined: Mon Feb 11, 2013 11:03 pm

Re: Create multiple Writer files from Calc spreadsheet data

Post by leptserkhan »

Ideally it would be best if I could convert the writer files to .doc files. I'm guessing there's a utility for that?
OpenOffice 3.4.1 windows xp
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Create multiple Writer files from Calc spreadsheet data

Post by acknak »

You can learn a lot just by giving it a try ...
Attachments
Click for full size
Click for full size
AOO4/LO5 • Linux • Fedora 23
leptserkhan
Posts: 5
Joined: Mon Feb 11, 2013 11:03 pm

Re: Create multiple Writer files from Calc spreadsheet data

Post by leptserkhan »

Perfecto!
OpenOffice 3.4.1 windows xp
User avatar
Villeroy
Volunteer
Posts: 31365
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Create Writer files from Calc spreadsheet data

Post by Villeroy »

:o

Always learning something new. I never noticed the file format option in the mail merge dialog.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
Villeroy
Volunteer
Posts: 31365
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: [Solved] Create Writer files from Calc spreadsheet data

Post by Villeroy »

OK, I tried to print out some form letter into a group of .doc files and found 2 issues:

1) The well known, old aged issue that you need to specify again the query in the mail merge dialog's top-left area if the record set comes from a query rather than table.
https://issues.apache.org/ooo/show_bug.cgi?id=57967

2) Option "generate file name from field" does not work. No file at all gets written.
https://issues.apache.org/ooo/show_bug.cgi?id=121757 (I just filed this issue)

Without this option a save-as dialog pops up. There I specify a path, file name "file" and file type "MS Word XP/2000(.doc)" which generates a sequence of files named file1.doc, file2.doc, file3.doc etc. I can open all the files in a 3rd party program (I have AbiWord at hand) and the result looks fine.
Mail merge dialog with 2 issues: click query to fill record set and don't use the name-by-field option.
Mail merge dialog with 2 issues: click query to fill record set and don't use the name-by-field option.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: [Solved] Create Writer files from Calc spreadsheet data

Post by acknak »

Villeroy wrote:OK, I tried to print out some form letter into a group of .doc files and found 2 issues:
...
2) Option "generate file name from field" does not work. No file at all gets written.
https://issues.apache.org/ooo/show_bug.cgi?id=121757 (I just filed this issue)
...[/attachment]
Thanks, V. I recalled that there was some kind of problem with the merge output, but I couldn't find any open bugs that seemed to fit.

Actually, my quick test using the bundled Bibliography db seems to work fine. With the "Identifier" field as the file name, and records 1-5, I get:
$ ls -st *0.odt | head
8 OOO020.odt
8 OOO010.odt
8 OOO000.odt
8 PAR000.odt
8 GUR000.odt
...
AOO4/LO5 • Linux • Fedora 23
Post Reply