PercTable {DescTools} - prevent output text wrapping - export-to-csv

My goal is to export PercTable output in a clean / HTML like format as JPG or CSV import into a presentation.
I get the "raw" table I want with this code:
Library(DescTable)
PercTable(syn_gender ~ recommend, data=dfXtab, rfrq="010", expected=TRUE)
It outputs as shown in graphic.
Screen snapshot for space saving
How can I export this output without the table wrapping the last 2 column?
Thank you - newbie.

The PercTable print routine uses the console width (getOption("width")) to define the table breaks. So the first solution is to simply enlarge the console width and print again.
Another option for output if you're on Windows is to use the Office export (package RDCOMClient needed):
library(DescTools)
tt <- PercTable(table(d.pizza$operator,
cut(d.pizza$temperature, breaks=6)))
wrd <- GetNewWrd()
ToWrd(tt$ftab)
would yield:

Related

.Bl, .It to render list in mandoc doesn't work on both macOS and Ubuntu 16.04

I try to use a proper macro like .Bl with its .It to render list in mandoc (or per say man page) with the following syntax (as seen in mdoc.7)
The arguments are as follows:
.Bl -tag -width Ds
.It Fl v
Print verbose information.
.El
Tried both on macOS and Ubuntu 16.04 by putting into .SH DESCRIPTION, and it doesn't render expected output. All I see is
The arguments are as follows: Print verbose information.
The steps I do this is
Edit mandoc file
Symlink it to target file at /usr/local/share/man/man3/
See result by man <filename>
PS. I didn't go any gzip.
What did I miss? How can I properly render list in mandoc?
Instead, I look at mandoc's code of /usr/share/man/man1/bash.1 in which I view such man page via man /usr/share/man/man1/bash.1 for safety to ensure I view the right file.
It uses the following syntax
.TP 10
.BI Item Name
Item description
.TP
.BI Item Name 2
Item 2 description
This will properly renders those two items in which the first column has 10 character in width. The second item will use the same column width as defined before. Much cleaner and simpler than what I tried but with not success in the question.
You will see the following output using above syntax

Put graphics behind the text in the same window of SapScript

I need to put a .bmp of a stamp behind some text in a sapscript form - in one window.
I've uploaded the bitmap of the stamp by using the se78, I uploaded it as standard text.
I'm already done some testing. This is what I got so far:
/: INCLUDE Z_ADRS_SIGN_CN30 OBJECT TEXT ID ADRS LANGUAGE EN
/: INCLUDE 'Z_SIGN_STAMP_CN30' OBJECT TEXT ID ST LANGUAGE EN
This is working, but the stamp gets printed under the text.
If I switch the code-lines, the stamp gets printed above the text.
Now to my question: Is there a way to print the stamp behind the text in one window ? And if yes, how?
It can be done, but it's better to use SmartForms for this, because it can print watermarks natively.
For SapScript:
Create SO10 text element and insert graphics object there
Put this statement into your text element
BITMAP 'YOURBMP' OBJECT GRAPHICS ID BMAP TYPE BCOL.
In the MAIN window of your form put these statements
INCLUDE BMP OBJECT TEXT ID ST.
NEW-WINDOW.
The key point here is NEW-WINDOW statement. It opens new window oon the page explicitly and prints all consecutive SapScript statements in the new window.

merging column in libreoffice calc does not work when drag down

I'm merging columns in Libre Office using the CONCATENATE function.
I'm merging all text using:
CONCATENATE(A1," ",B1," ",C1," ",D1," ",E1," ",F1," ",G1)
According to this suggestion, I should be able to apply the function over the whole column by dragging the plus sign; however, when I drag the plus sign, it only copies the first line, but I want to merge the next row.
How can I merge the columns correctly?
#oczdref, I am not sure why this would not work in your situation. Here is what I did (please ignore the ; separators, in your case they should remain ,)
I also found out that you must enable the "AutoCalculate" under Tools -> Cell contents
so that when you drag the autocomplete function instead of getting the result
something like this:
and the result that i want to.

Command to "format" txt Files

I have several TXT files like the example bellow in a certain solder:
5600001254545 - Bar code
12 - Quantity
5600000785487 - Bar code
250 - Quantity
I need to writte a code to place the line of the quantity in front of the code bar, separated by; in all the files without opening them one by one or doing it on Excel.
Can you please help me?
Regards,
Try to do it with a text editor supporting regular expressions (Maybe Editplus, Textpad++, ...).
Open your text files with such editor and replace "Bar code\n" by "Bar code;". This way you will have just one line with both the barcode and the quantity data.

How do I create a text file so when it is opened in Excel, rows are grouped together?

I'm collecting some data via a Perl script. The data needs to be reviewed and processed by others using Excel. Currently, I'm writing the data out as a tab-delimited text file, and Excel can open this just fine.
There's a hierarchy to the data, however, and it would be easier for the reviewers to see a tree rather than a flat list. That is, rather than presenting the data in columns,
foo foo1
foo foo2
foo foo3
bar bar1
bar bar2
...
present it as a click-to-expand tree:
foo
foo1
foo2
foo3
bar
bar1
bar2
...
Excel's group function (found in 2007 under "Data > Outline > Group") is a good match for this presentation, being a bit simpler to operate than pivot tables.
What is the easiest way for us to go from this flat list of columns to this grouped list? Ideally, I could write out the data in a text form that Excel would apply the grouping automatically when it was imported. Alternatively, if there were a small number of steps the reviewer could apply after importing the data, like applying a macro or a template, that would be OK too.
Since you are already using perl, I suggest that you create the excel file directly in perl using the excellent CPAN module Spreadsheet::WriteExcel which has support for Excel outlines.
Works something like this:
.
.
$worksheet->write('A2', 'foo');
$worksheet->write('B3', 'foo1');
$worksheet->write('B4', 'foo2');
$worksheet->write('B5', 'foo3');
$worksheet->set_row(2, undef, undef, 0, 1, 1);
$worksheet->set_row(3, undef, undef, 0, 2);
$worksheet->set_row(4, undef, undef, 0, 2);
$worksheet->set_row(5, undef, undef, 0, 2);
.
.
Select all the rows, including the column headers, in the list you want to filter.
ShowTip
Click the top left cell of the range, and then drag to the bottom right cell.
On the Data menu, point to Filter, and then click Advanced Filter.
In the Advanced Filter dialog box, click Filter the list, in place.
Select the Unique records only check box, and then click OK.
The filtered list is displayed and the duplicate rows are hidden.
On the Edit menu, click Office Clipboard.
The Clipboard task pane is displayed.
Make sure the filtered list is still selected, and then click Copy Copy button.
The filtered list is highlighted with bounding outlines and the selection appears as an item at the top of the Clipboard.
On the Data menu, point to Filter, and then click Show All.
The original list is re-displayed.
Press the DELETE key.
The original list is deleted.
In the Clipboard, click on the filtered list item.
The filtered list appears in the same location as the original list.
Recent versions of Excel (2003 is what we use here) can use an XML format, xlsx. An xlsx file is a zip of an XML file. If you want to make a file that will open in Excel with the settings you want, try this: first create a template file with the grouping you want. Save it as xlsx. Unzip the file using your standard zip software. Take a look at what's inside. I haven't worked with grouping specifically, but all the commands in your spreadsheet will be there in xml form, you'll need to figure out where the grouping is set. Then it's a matter of making the appropriate changes to the xml and re-zipping. A bit of effort, but you can use this method to programmatically create files that are pre-grouped. There may be Perl libraries specifically geared towards this, I don't know.
A CSV file is also very easy to generate. OpenOffice lets you choose how to parse things, but excel excepts comma-delimited columns (without any kind of quote) and CRLF delimited rows.
A1,A2,A3
B1,B2,B3
etc.