It would be nice if the @export capability had a "text" option
a
anonymous
started a topic
over 17 years ago
[This topic is migrated from our old forums. The original author name has been removed]
I know that the CSV option is more or less text, but what I'm really looking for is the text to be formatted like the text view from a result set, with the nicely formatted column headers, columns sized correctly, etc, rather than just run together or separated by commas or tabs. It would also be nice if there was an option to separate multiple result sets by blank lines.
Re: It would be nice if the @export capability had a "text" option
Hi Sammy,
Thanks for your suggestion. I assume you mean that you want this functionality for the Data tab. In the SQL Commander, you can already export the formatted text for a result set.
I'm not sure I understand your suggestion regarding multiple result sets. Can you elaborate a bit?
Thanks,
Hans
Hans Bergsten
said
over 17 years ago
[This reply is migrated from our old forums.]
Re: It would be nice if the @export capability had a "text" option
Uh, please ignore my question about the Data tab; if I had read the title of your post more carefully, I would have noticed that you want this for the @export command. In that context, I also understand what you mean regarding multiple result sets.
I'll add this to the list of features to look at for future versions.
Thanks,
Hans
Roger Bjärevall
said
over 17 years ago
[This reply is migrated from our old forums.]
Re: It would be nice if the @export capability had a "text" option
Sammy,
Doing @export in "text" format was on the original wish list. The problem is however that the complete result set need to be fetched before the column sizes can be determined. This breaks the current intention with @export as it outputs each record on the fly when it has been fetched.
What I mean with "problem" here is that @export to file is supposed to work independent how much RAM is available and how large the result set is.
Your request is as Hans have mentioned on the list and we'll look into a potential "tweak".
Regards
Roger
a
anonymous
said
over 17 years ago
[This reply is migrated from our old forums. The original author name has been removed]
Re: It would be nice if the @export capability had a "text" option
*IF* your result set has no spaces in it, you can pipe it through the Linux 'column' command to turn the data into a nice table (with each column sized to the width of the largest piece of data in it). 'column' uses whitespace as the delimiter (it would be nice if it had the option to specify the tab character as the delimiter, but mine doesn't) so any spaces in the data would be interpreted as column separators.
There may be a similar program out there that you CAN force to use a tab as the delimiter. Find one of those, and you're home free.
[pre]printf "COL1 COL2 COL3\nsomedata some.more.data blah\naaa bbb ccc\n" | column -t
COL1 COL2 COL3
somedata some.more.data blah
aaa bbb ccc[/pre]
anonymous
Thanks,
Sammy