Perhaps read a few posts up?
There are at least 5 posts discussing this - it's not a bug and not an issue with the "?" char.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Perhaps read a few posts up?
Code: Select all
If the result is "can't find file" then
put item n+1 of tList into tNextFileName
put tOldFileName & tNextFileName into tCorrectedOldFileName
if there is a file tCorrectedOldFileName then
rename tCorrectedOldFileName to tNewFileName
add one to n
end if
end if
Ouch! Sorry to here that you were having problems - strange how people bite the hand that feeds them. What age is the father? I thought they were suppose to remain in Ukraine and fight if they were between 18 and 60?got badly bogged down sorting out things with some Ukrainian refugees' children last weekend.
About 45: mind you, I'd be scared if he had a gun in his hand, even if, theoretically, he were on my side.they were suppose to remain in Ukraine and fight if they were between 18 and 60?
would make a great forum name!Pirate King of Plovdiv
If it were me, i'd run through the the list of real or broken filenames and if there was a char with ascii code < 32, i'd try to rename *all* the files then try again. It would probably mean having to use console commands to do the renaming on a unix level but that would be a matter of consulting our dear friend Mr GoogleSimon Knight wrote: ↑Thu Apr 14, 2022 11:14 am# Stam,
Unfortunately while your code is quite correct there is no simple method of feeding it data. The problem is how do you get it a list of filenames that include the newline character ? It cannot be achieved using Livecode Files as this uses the newline character as the item separator. This is exactly the problem discussed in the link I quoted above. The tools that are used will in certain circumstances return incorrect data. Remember with my subject files Livecode never sees the question mark also there is a very good chance that the question mark is a place holder for any number of strange characters that are quite legal in Unix file names.
Yes @mainmein39, the OP could and in actual fact has - the only problem is that no one actually reads the long threads they respond to.mainmein39 wrote: ↑Wed May 11, 2022 11:24 amI see that "replaceText" lives strictly within regex. But, since "null' is a constant in LC, then could not the OP simply use the "replace" command?
stam wrote: ↑Mon Apr 11, 2022 11:15 amNo need for all that Richmond, Simon already has a working version of this that is simply one line:
his issue was that replaceText(tProblem, null, "") doesn't work. That's because the find criterion is regex and not free text or keywords, so the syntactically correct way of doing this isCode: Select all
replace null with "" in tProblem
Code: Select all
replaceText(tProblem, "\0", "")
That will be the character ASCII 00.As the null is nothing I wonder what is going to be replaced.