From 2c796e8fcb01942621aaa58c1faf61f841800319 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Tue, 6 May 2008 05:54:19 +0000 Subject: [PATCH] * csv2lyx: - make output more closely to format 276. This also prevents lyx2lyx from choking while importing a csv file into 1.6. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24626 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/scripts/csv2lyx.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/scripts/csv2lyx.py b/lib/scripts/csv2lyx.py index fe8ba275c7..f0ea2bfe1c 100644 --- a/lib/scripts/csv2lyx.py +++ b/lib/scripts/csv2lyx.py @@ -108,12 +108,12 @@ fout.write("""#csv2lyx created this file \\end_header \\begin_body -\\begin_layout Standard -\\align left +\\begin_layout Standard +\\align left \\begin_inset Tabular -\n""") -fout.write('\n') +""") +fout.write('\n') fout.write('\n') ##################### # write table @@ -135,9 +135,10 @@ while j < num_rows: while i < num_cols: fout.write(""" \\begin_inset Text + \\begin_layout Standard\n""") - fout.write(row[i]) - fout.write('\\end_layout\n\\end_inset\n\n') + fout.write(row[i].strip('\n')) + fout.write('\n\\end_layout\n\n\\end_inset\n\n') i += 1 fout.write('\n') j += 1 @@ -145,8 +146,12 @@ while j < num_rows: # write last part #################### fout.write(""" + \\end_inset + + \\end_layout + \\end_body \\end_document\n""") fout.close() -- 2.39.2