unrtf has no way to disable the header that's printed out

Bug #489128 reported by Rory McCann
30
This bug affects 6 people
Affects Status Importance Assigned to Milestone
unrtf (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: unrtf

I created a simple RTF file in OpenOffice with one word "testing". I then used unrtf to convert it to text on the command line like so:

unrtf -t text test.rtf 2>/dev/null

(Note the 2>/dev/null is to work around LP #489122)

this is output I got:

### Translation from RTF performed by UnRTF, version 0.19.2
### For information about this marvellous program,
### please go to http://www.gnu.org/software/unrtf/unrtf.html
### document uses ANSI character set
### font table contains 4 fonts total

AUTHOR: Rory McCann
### creaton date: 27 November 2009 09:54
### revision date:
### last printed:
### comments: StarWriter

-----------------
testing

The stuff before the "----------" is header stuff about the file, it is not in the RTF file itself. There should be a way to turn this off. I, the user, want to get the plain text equivilant of this file, all these #### lines are not in the original file, so there should be some other way to just get What You See In OpenOffice.

ProblemType: Bug
Architecture: i386
Date: Fri Nov 27 09:59:38 2009
DistroRelease: Ubuntu 9.10
Package: unrtf 0.19.3-1.1
ProcEnviron:
 PATH=(custom, user)
 LANG=en_IE.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-15.50-generic
SourcePackage: unrtf
Uname: Linux 2.6.31-15-generic i686
XsessionErrors:
 (gnome-settings-daemon:1841): GLib-CRITICAL **: g_propagate_error: assertion `src != NULL' failed
 (gnome-settings-daemon:1841): GLib-CRITICAL **: g_propagate_error: assertion `src != NULL' failed
 (nautilus:2067): Eel-CRITICAL **: eel_preferences_get_boolean: assertion `preferences_is_initialized ()' failed
 (polkit-gnome-authentication-agent-1:2136): GLib-CRITICAL **: g_once_init_leave: assertion `initialization_value != 0' failed
 (gnome-panel:1940): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -5 and height 24

Revision history for this message
Rory McCann (rorymcc) wrote :
Revision history for this message
neuromancer (neuromancer) wrote :

Hi.
I use unrtf in a project with Lucene and Zend framework.
To throw away the header part, i use this workaround:
unrtf --text --nopict filename.rtf | awk 'NR == 1, /-----------------/ { next } { print }' > outfile

Changed in unrtf (Ubuntu):
status: New → Confirmed
Revision history for this message
Olly Betts (ojwb) wrote :

This is fixed in 0.21.3:

    - added '--quiet' flag which suppresses leading comments in output

Changed in unrtf (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Alexandrosg (alexandrosg) wrote :

The quiet flag appears to do nothing on my system, with version 0.21.3

Revision history for this message
Hamish Low (sub-acoustic) wrote :

The quiet flag also not working for me on 0.21.3

Revision history for this message
Wim Feijen (wim-go2people) wrote :

On Ubuntu 16.04.2 LTS, unrtf version 0.21.9 --quiet does not work for me as well.

unrtf result.rtf --quiet --text
### Translation from RTF performed by UnRTF, version 0.21.9

-----------------
LEDES98BI V2[]INVOICE_DATE|INVOICE_NUMBER|CLIENT_ID|LAW_FIRM_MATTER_ID|INVOICE_TOTAL|BILLING_START_DATE|BILLING_END_DATE|INVOICE_DESCRIPTION|LINE_ITEM_NUMBER|EXP/FEE/INV_ADJ_TYPE|LINE_ITEM_NUMBER_OF_UNITS|LINE_ITEM_ADJUSTMENT_AMOUNT|LINE_ITEM_TOTAL|LINE_ITEM_DATE|LINE_ITEM_TASK_CODE|LINE_ITEM_EXPENSE_CODE|LINE_ITEM_ACTIVITY_CODE|TIMEKEEPER_ID|LINE_ITEM_DESCRIPTION|LAW_FIRM_ID|LINE_ITEM_UNIT_COST|TIMEKEEPER_NAME|TIMEKEEPER_CLASSIFICATION|CLIENT_MATTER_ID|PO_NUMBER|CLIENT_TAX_ID|MATTER_NAME|INVOICE_TAX_TOTAL|INVOICE_NET_TOTAL|INVOICE_CURRENCY|TIMEKEEPER_LAST_NAME|TIMEKEEPER_FIRST_NAME|ACCOUNT_TYPE|LAW_FIRM_NAME|LAW_FIRM_ADDRESS_1|LAW_FIRM_ADDRESS_2|LAW_FIRM_CITY|LAW_FIRM_STATEorREGION|LAW_FIRM_POSTCODE|LAW_FIRM_COUNTRY|CLIENT_NAME|CLIENT_ADDRESS_1|CLIENT_ADDRESS_2|CLIENT_CITY|CLIENT_STATEorREGION|CLIENT_POSTCODE|CLIENT_COUNTRY|LINE_ITEM_TAX_RATE|LINE_ITEM_TAX_TOTAL|LINE_ITEM_TAX_TYPE|INVOICE_REPORTED_TAX_TOTAL|INVOICE_TAX_CURRENCY[]
...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.