User defined fixed column width text import



Folks,

I recently had trouble importing a text file into Gnumeric 1.2.13 that might have gone more smoothly if there was an option to set a user defined column width.

The table in question was formated like Table 1 below. This smaller example imports corectly with the space delimited option, but the real table I was working with had 1325 rows and 1325 columns. I compiled Gnumeric with SHEET_MAX_COLS 8X8x8x8 to get the necessary columns beyond the default 256.

Importing the 1325 X 1325 table using the space delimited option, including "see two separators as one" would run to completion, but inspection of the resulting sheet revealed that many columns had simply been dropped. All the rows were present.


My short term solution after some trial and error was filling the columns that had spaces (column 1) with a non-space character (*). With this modification Table 2 imported correctly with the "automatically detected" file type option.

While I was devising this workaround it occurred to me that my problem would have been easily solved if Gnumeric had the option to set a user defined column width. Probably 8 in this case. How would others approach this problem using the available options in Gnumeric 1.2.13? Tweaking the text file was a bit laborious.

Cheers,
Matt


Note: Use a non-proportional font such as courier to get a clear look at the table formating.

Table 1. Small table that imports fine with space delimited option. The complete 1325 x 1325 version drops columns on import.

5
Bac.putred
U81709 0.834146
Rik.mifusu 0.878166 0.828671
str.2008 0.828125 0.797403 0.814621
str.1035 0.828125 0.797403 0.814621 1.000000


Table 2. Columns with spaces were filled with a non-space character (*). This modification of the 1325 x 1325 table imports correctly with "automatically detected" file type option.

5
Bac.putred
U81709**** 0.834146
Rik.mifusu 0.878166 0.828671
str.2008** 0.828125 0.797403 0.814621
str.1035** 0.828125 0.797403 0.814621 1.000000

--
Matthew T. Cottrell, Ph.D.
Associate Scientist
University of Delaware 302 645 4383
Lewes, DE 19958 Matt Cottrell mac com


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]