Find & Replace in Procedure window

I have some import text file code generated that changes each day by date. Not knowing good coding, I wanted to find and replace the date in my procedure code and then import the file. When I try this in the procedure window, all I get is a bell sound when selecting find&replace, nothing more.
Here is the code:

importtext arrayrange(lftocr(binarytotext(fileload("/Users/TrackmanPete/Downloads/county-new-castle-covid-19-all-downloadable-data-2020-09-25.csv"))),2,-1,cr()),"ExistingData","Replace","AddFields","No","ReArrange",""+tab()+importcell(6-1)+tab()+importcell(7-1)+tab()+importcell(5-1)+tab()+importcell(2-1)+tab()+importcell(3-1)+tab()+importcell(4-1)+tab()+""+tab()+importcell(8-1)

I want to change 2020-09-25.csv to 2020-09-26.csv. There doesn’t seem to be the ability to find the “25” and then change all of them to “26”.

In another thread Jim talked about using morph, but that is in a datasheet setup, I believe.

If this find & replace is not available yet, is there a way I can input a new file everyday by making the date part a wildcard?


If, instead of Find and Replace, you just choose Find, you get something like this.

Check the box marked Replace to get that second box where you can type the value you want to replace it. Click All to do all the replacements at once.

Ah, thank you Dave. I now do recall seeing that dialog.

Get BlueMail for Android

Dave has given you the basics, this is also documented on this help page, look for Find & Replace.

Note that the Find and Find/Replace features are actually standard macOS features, this feature works identically in Panorama procedure editors as it does in many other Mac text editors. In your application you probably want to click the magnifying glass and switch to “full word” instead of “contains”, otherwise you might change something like 251 to 261.

Actually, my suggestion would be to factor out the date into a separate variable, so that it can be changed easily, something like this.

let grabdate = "2020-09-25"
importtext arrayrange(lftocr(binarytotext(fileload("/Users/TrackmanPete/Downloads/county-new-castle-covid-19-all-downloadable-data-"+grabdate+".csv"))),2,-1,cr()),"ExistingData","Replace","AddFields","No","ReArrange",""+tab()+importcell(6-1)+tab()+importcell(7-1)+tab()+importcell(5-1)+tab()+importcell(2-1)+tab()+importcell(3-1)+tab()+importcell(4-1)+tab()+""+tab()+importcell(8-1)

You could even have it prompt for the date or automatically use today’s date.

Thank you, Jim. What has not been addressed is that in going to the sub-menu of the Find command in the Procedure window, if you select Find&Replace, all one gets is a beep. I was able to automate the find and replace change via code. Thank you for sending me in the right direction.

I see that if I open a file in Pages, the edit menu only has Find…, not Find and Replace… On the other hand, TextEdit has both. This may indicate that Apple is transitioning.

Oddly, in experimenting with this, I found that TextEdit now seems to open PDF files as text files.

I checked the source code, and Panorama is calling an Apple API to open the Find/Replace panel when this menu item is selected. It’s Apple’s code that is producing the beep (and doing nothing else). Unfortunately there is no alternate way that I can find to open the Find/Replace panel with the Replace checkbox already checked.

Jim: Thanks for checking on this. I just thought I would make you aware of this. Dave and your suggestions have worked well. I am almost able to generate a daily list with one push of a button. After 3 year of Pan X, I am slowly starting to get the hang of things. Thank goodness for the recorder, what a lifesaver that has been.