Re: tabs to spaces
Re: tabs to spaces
- Subject: Re: tabs to spaces
- From: Scott Haneda <email@hidden>
- Date: Mon, 1 Dec 2008 16:55:09 -0800
Thanks to all who are helping me on this, using your examples, I am
working through understanding a lot more of this. I am a little
stumped on AS list manipulation.
This is related to tabs to spaced, but more general list based
questions.
Given input of a large string of data, basically, tab seperated, and
return or newline seperated per line, where there very well may be
spaces in the data in each word...
Something like this:
dasdaads dasdas dasdas das
ds dsd dasd dsad dd ds
Lets call the above data my_data
set lines to {}
set lines to paragraphs of my_data
So, that will get me a list where each line is a list element?
Something like this: {line1, line2} ?
If I then wanted to iterate though the lines and convert each tab
seperated chunk to a list as well
repeat with a_line in lines
-- What do i do here?
-- I think this is it, but it is not working well for me
set AppleScript's text item delimiters to tab
set cells to text items of a_line
set text item delimiters to ""
end repeat
And there is where I am stuck, what I would love, is a nice list back:
{ {"dasdaads", "dasdas", "dasdas", "das"},
{"ds dsd", "dasd", "dsad", "dd ds"} }
Just before the creation of that list, I would be able to apply
stringPadRight() to each cell word, and get them all the same length.
From there, is there a way to split() in AS, or suggestion on simply
way to go back to \r separated lines, with a single space between each
item of the words in the list.
Also, is there way to return the clipboard with a style attribute,
such as setting it to Monaco?
Thanks for all the help, still working through a lot of the examples
that many of you posted, thank you.
--
Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden