Folgen Sie dem Video unten, um zu sehen, wie Sie unsere Website als Icon auf Ihrem Homescreen erstellen.
Anmerkung: This feature may not be available in some browsers.
set txt to "Hier stört ein Text mit einigen Ümläuten."
set w_list to every word of txt
copy w_list to w_list_2
set have_diacriticals to {"ä", "ë", "ï", "ö", "ü", "ÿ"}
set od to AppleScript's text item delimiters
repeat with J from 1 to count w_list_2
set AppleScript's text item delimiters to have_diacriticals
set w to item J of w_list_2
considering diacriticals
set l to every text item of w
end considering
set AppleScript's text item delimiters to "ᚄ"
set w to l as text
set item J of w_list_2 to w
end repeat
set word_list to {}
repeat with J from 1 to count w_list_2
set w to item J of w_list_2
if w contains "ᚄ" then
copy item J of w_list to end of word_list
end if
end repeat
set AppleScript's text item delimiters to word_list
considering diacriticals
set l to every text item of txt
end considering
set AppleScript's text item delimiters to ""
set r to l as text
set AppleScript's text item delimiters to od
r
set txt to "Hier stört ein Text mit einigen Ümläuten."
set w_list to every word of txt
set have_diacriticals to {"ä", "ë", "ï", "ö", "ü", "ÿ"}
set od to AppleScript's text item delimiters
set AppleScript's text item delimiters to have_diacriticals
set word_list to {}
-- variant for smarter handling of spaces
(*
set word_list_l to {}
set word_list_r to {}
*)
-- find all words with “forbidden” characters
-- and copy them to a new list
repeat with J from 1 to count w_list
set w to item J of w_list
considering diacriticals
set l to every text item of w
end considering
if (count l) > 1 then
set c to item J of w_list
copy c to end of word_list
-- variant for smarter handling of spaces
(*
copy " " & c to end of word_list_l
copy c & " " to end of word_list_r
*)
end if
end repeat
-- remove forbidden words
considering diacriticals
-- variant for smarter handling of spaces
(*
set AppleScript's text item delimiters to word_list_l
set l to every text item of txt
set AppleScript's text item delimiters to ""
set txt to l as text
set AppleScript's text item delimiters to word_list_r
set l to every text item of txt
set AppleScript's text item delimiters to ""
set txt to l as text
*)
set AppleScript's text item delimiters to word_list
set l to every text item of txt
set AppleScript's text item delimiters to ""
set r to l as text
end considering
set AppleScript's text item delimiters to od
r
echo "Hier stört ein dämlicher, aber schöner Text mit einigen Ümläuten." | sed 's/[A-Za-zäöüÄÖÜß]*[Ä|Ö|Ü|ä|ö|ü][A-Za-zäöüÄÖÜß]*[^,|^\.|^\ ]//g;s/\ \ /\ /g;s/\ \././g;s/\ ,/,/g;'
echo "Hier stört ein dämlicher, aber schöner Text mit einigen Ümläuten." | sed 's/[A-Za-zäöüÄÖÜß]*[Ä|Ö|Ü|ä|ö|ü][A-Za-zäöüÄÖÜß]*[,|\.|\ ]*//g'
echo "Hier stört ein dämlicher, aber schöner Text mit einigen Ümläuten." | grep -o '[A-Za-zäöüÄÖÜß]*[Ä|Ö|Ü|ä|ö|ü][A-Za-zäöüÄÖÜß]*'
echo "Hier stört ein dämlicher, aber schöner Text mit einigen Ümläuten." | grep -o '[A-Za-zäöüÄÖÜß]*[Ä|Ö|Ü|ä|ö|ü][A-Za-zäöüÄÖÜß]*'
grep -o '[A-Za-zäöüÄÖÜß]*[Ä|Ö|Ü|ä|ö|ü][A-Za-zäöüÄÖÜß]*' Datei1.txt > Datei2.txt
SYNOPSIS
grep [options] PATTERN [FILE...]
set InputDatei to "~/Desktop/test/text.txt"
set OutputDatei_1 to "output1.txt"
set OutputDatei_2 to "output2.txt"
set Pfad to (path to "desk" as string) & "test:"
set Output_1 to (open for access file (Pfad & OutputDatei_1) with write permission)
set Output_2 to (open for access file (Pfad & OutputDatei_2) with write permission)
try
set txt1 to do shell script "sed 's/[A-Za-zäöüÄÖÜß]*[Ä|Ö|Ü|ä|ö|ü][A-Za-zäöüÄÖÜß]*//g''' " & InputDatei
set txt2 to do shell script "grep -o '[A-Za-zäöüÄÖÜß]*[Ä|Ö|Ü|ä|ö|ü][A-Za-zäöüÄÖÜß]*' " & InputDatei
write txt1 to Output_1
close access Output_1
write txt2 to Output_2
close access Output_2
on error
close access Output_1
close access Output_2
end try