From c3704bd8fb760e7a4b40b3067031030a6c5d1ec7 Mon Sep 17 00:00:00 2001 From: David Stephens Date: Sat, 31 May 2014 20:16:27 -0700 Subject: [PATCH] ENH: Remove newlines from cells in to_string --- pdftables/display.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdftables/display.py b/pdftables/display.py index 931280a..bf5a220 100755 --- a/pdftables/display.py +++ b/pdftables/display.py @@ -25,7 +25,7 @@ def to_string(table): result.write(hbar) for row_index, row in enumerate(table): - cells = [cell.rjust(width, ' ') for (cell, width) + cells = [cell.replace('\n', '').rjust(width, ' ') for (cell, width) in zip(row, col_widths)] result.write("{:>3} | {}|\n".format(row_index, '|'.join(cells))) result.write(hbar)