hello forum
i simply want to number every paragraph of a text file
for example i have :
" abab
caca
baba"
i want
“01-abab
02-caca
03-baba”
i know its seems easy but im stuck with that :
set the_file to (((path to desktop) as string) & "mytext.txt") as file specification
set all_lines to paragraphs of (read the_file)
set the_count to ((count of all_lines))
repeat with i from 1 to the_count
if i > 9 then
set the_para to ((i as string) & "-")
else
set the_para to ("0" & (i as string) & "-")
end if
set paragraph i to ((the_para & "paragraph i") as string)
Your subject line is misleading because your net using TextEdit. The key is that you need to replace the item in the list with the combined number and paragraph. Try this:
You’re welcome, and, for clarification, in my post above, that should be “not using…” not “net using…” I really shouldn’t post in the middle of a migraine.