Re: Merging Columns in Excel
Re: Merging Columns in Excel
- Subject: Re: Merging Columns in Excel
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 17 Feb 2002 20:11:16 -0800
On 2/17/02 1:59 AM, "David Wignall" <email@hidden> wrote:
>
Oops, this has been sitting in my Drafts for nearly a week waiting for me to
>
do something. Sorry.
>
>
on 12/2/02 6:59 pm, Paul Berkowitz at email@hidden wrote:
>
>
> Is there a way to merge columns in Excel AppleScript? I'm told that there is
>
> a way to do this in the UI, so I'm curious. Since my data is ultimately
>
> destined for a tab-delimited text file, I'm just doing it row by row (Value
>
> of Row, combine items of list with " " between them). It might be neater to
>
> let Excel do it, although I gather it creates a carriage return that way. (I
>
> won't be Saving As... Text because I don't want all the quotation marks
>
> around cell values with punctuation, but will be substituting special
>
> characters for returns, etc.)
>
>
The only time I see quote marks when I "Save as xlText" is when the cell
>
value already possesses quote marks, in which case it "triples" them; from
>
memory that is a VBA way of escaping double quotes. You do get returns at
>
the end of all but the last row. No other punctuation causes any similar
>
issue.
>
>
Have you got an example we can play with?
I can fish it out. But honestly - there were two circumstances which created
extra quotes:
1) Cells that contain carriage returns within them
2) Cells that contain commas within them.
(I imagine that if you could type a tab-character within a cell, that would
get them too, but you can't.)
It's actually a very clever system, understood and honored by lots of MS
apps (and others perhaps) on Windows: I've inspected tab-delimited and
comma-separated text files exported from Outlook 2000's contacts folders and
calendar. And I've even incorporated the same thing myself when converting
text files from Entourage and OE Mac exports to be used by Outlook's import
engines. When they see quotes (except doubled ones, as you say), they treat
carriage returns and commas within as text in a field, not as record or
field separators.
But this time I'm going the other direction and need to replace the carriage
returns by special symbols which my own Import scripts will restitute as
CRs, or just as spaces if they occur in places I don't expect. It's all
worked out fine just converting the Excel worksheet to a tab-delimited text
field by AppleScript instead of using the "Save As..." Text (Tab) feature.
(On Windows side, they do it by macro when they want quoteless text files.
it's a known issue there too.)
Many thanks for pitching in.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.