Re: Newbie blues (was Remove spaces)
Re: Newbie blues (was Remove spaces)
- Subject: Re: Newbie blues (was Remove spaces)
- From: Kai <email@hidden>
- Date: Sun, 29 Jun 2003 17:15:05 +0100
on Sun, 29 Jun 2003 15:50:49 +0200, Bernard Azancot wrote:
>
More details:
>
Open a Filemaker export tab-return file with TE+.
>
Search all the (french) phone numbers appearing as "xx xx xx xx".
>
Change them to "xxxxxxxx"
>
Re-import the file to FM.
>
Text sample:
>
=-=-=-=-=-=-=-=-=-=-=-=-=
>
Blablah Blablah Blablah Blablah Blablah 12 34 56 78 78
>
Blablah Blablah Blablah Blablah Blablah Blablah Blablah Blablah
12 34 56 78 78
>
Blablah Blablah Blablah Blablah Blablah 12 34 56 78 78
>
>
To change to:
>
=-=-=-=-=-=-=-=-=-=-=-=-=
>
>
Blablah Blablah Blablah Blablah Blablah 1234567878
>
Blablah Blablah Blablah Blablah Blablah Blablah Blablah Blablah
1234567878
>
Blablah Blablah Blablah Blablah Blablah 1234567878
>
>
=-=-=-=-=-=-=-=-=-=-=-=-=
>
>
Note:
>
It would be easy to make it in Filemaker, but I prefer to make it
"externally".
Right. You could do it externally using the file read/write commands from
Standard Additions but, since we're already talking about Tex-Edit Plus (and
you can also see what's going on), let's continue in the same vein...
I have to go out just now, so this is a bit rough-and-ready, but you might
like to play around with it to see if any other issues arise. (Apart from
the odd extra carriage return, it assumes that every line is roughly the
same format, contains tabs - and ends with a telephone number):
-------------------------------------------------------
(Any wrapped lines abutting the left edge of the window
should be reconnected to the end of the previous line)
-------------------------------------------------------
--==================================================================
tell application "Tex-Edit Plus" to activate -- if you want to watch
set e to count application "Tex-Edit Plus"'s window 1's paragraphs
repeat with n from 1 to e
set p to application "Tex-Edit Plus"'s window 1's paragraph n
if (count p) > 1 then -- continue if the paragraph isn't empty
set text item delimiters to tab
set {a, b} to p's {text 1 thru text item -2, text item -1}
set {b, text item delimiters} to {b's words, ""}
set application "Tex-Edit Plus"'s window 1's paragraph n to a &
tab & b
end if
end repeat
--==================================================================
--
Kai
_______________________________________________
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.