Tinderbox Forum

Find Replace, but How?

Dear all,
I hope everyone is doing well.
Well, I was practicing the Find Replace function and stumbled upon it.
In the example file “daily note v01.tbx” from the forum below,
what “function” can I use to convert the date
from 2020 to 2021 for all 360 days of the note title?
I would be very grateful if you could help me.
Thx and regards, WAKAMATSU
[[Daily Note-- how to set up a daily note TBX - #3 by eastgate]]

Ah, wonderful question. I use .replace all the time (great for fixing consistent spelling errors and changing other consistent patterns). Here you go.

In the attached demo file you can select a note and apply the stamp. This code could as easily be used in a Rule or Edict, but you want to be sure to test it in a Stemp before you let it run wild across all your notes. Finally, you can use regex patterns as part of your fine.
TBX L - Siimple .Replace for replacing terms in text.tbx (77.5 KB)

Dear Michael Becker,
Thanks a lot for your referential.tbx.
Stamps : .Replace
$Name=$Name.replace(“2020”,“2021”);
Your stamp works.
[daily note v01.tbx] had a change Year Stamp
$MyString $MyString.replace(“2020”,“2021”).
This [$MyString.replace] stamp could not be changed in bulk in 2021.

Now, there are changes to follow after this work.
What kind of replace should I write to change the start date?
Thx and regards, WAKAMATSU

Tinderbox stores the data value in a long format, e.g. Sep 8, 2021 at 6:14 AM. So you should be able to use the same operation.

Dear Michael Becker,
Replace on StartDate : Stamps
$StartDate=$StartDate.replace(“2021”, “2021”);
This stamp does not allow me to change the StarDate in the Event.
Can not I just call the calendar view for 2021 and then
move the dates around (or add them all together, add one day at a time)
to change the start date?
TinderboxDailiy

Also, what function should I use if I want to display a summary by month?
Thx and regards, WAKAMATSU

P.S
Is it possible to set up something like this?
Once I call Use Inherited Value for StartDate, the calendar displayed next to
it will be today’s date.
When I click on a date in this calendar, the “Start Date” is quickly changed.
Is there an equivalent command that can do like this?
Respectfully, WAKAMATSU

Might there be an error in your stamp? Both dates are 2021?

Not sure what you mean by “calendar view”.

The Calendar is just a UI to help set a date, Stamp accomplishes the same thing.

Dear Michael Becker,
Thank a lot.
That was my mistaken in writing the same year
in replace on StartDate.
I corrected the mistake that it was the same year.
I ran the stamp, but
The date is off by one day.
The name of the Note is September 6, 2021.
The start date is September 7, 2021.
The other dates also change by one day.
ChangeStartDate

The fix should be something like “date➖1 day”.
Where should I put this correction?
I would be grateful for your wisdom.
Respectfully, WAKAMATSU

I’ve never been great with date manipulation. If you need it to be a specific date, then you can just set that specific date. I don’t know what you’re trying to accomplish, exactly. What their other considerations are, so I’m hesitant to offer specific recommendations.

Dear Michael Becker,
Let’s take a closer look.
I have executed the stamp to change the start date.
However, the modified StartDate is always set to the date one day ahead.

I simply changed the start date, but the “date” is different.

What could be the cause of the different “dates”?

Is it the time difference between Japan and the US?

Or is it because the “date” set in the daily note v01.tbx
Is it because the “date” set in daily note v01.tbx is different from Japan time?
If you have time, could you please check the date setting of daily note v01.tbx?
Respectfully, WAKAMATSU
P.S
Daily Note-- how to set up a daily note TBX - Q & A - getting started with Tinderbox - Tinderbox Forum
[[Daily Note-- how to set up a daily note TBX]]

Ok, I think I know what you’re trying to do. You’re trying to use this file as a template to manage your daily journal. Personally, I would not do it this way, just has a bunch of future notes, you may or may not need. I would have the day of the note create on the fly you add the note to your daily journal folder. See attached example:

TBX L- Daily Journal and $OnAdd Example.tbx (97.0 KB)

Dear Michael Becker,
Thank you for creating such a detailed example.
I will start practicing tomorrow on how to write a diary.
I have been using LaTeX to make notes of daily events,
but now I am thinking of moving to Tinderbox.
Respectfully, WAKAMATSU

1 Like