# Doing rewind / replay, part 2

While the Python we used to drive [Rewind / replay, part 1](https://www.csvpath.org/topics/how-tos/rewind-replay/doing-rewind-replay-part-1) was not complicated, using the CLI would be even quicker and in a triage situation might be a better option. So let's try that.

We'll use the same data and csvpaths for this second example. Only our use of the CLI is different. Because it is the same activity we'll do it quickly and let you refer back to part 1 for the background information.

Here are our files. Two sets of three csvpaths and one data file.

{% file src="<https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2F9UD4q3tFnYlF1NaymjXY%2Fpeople.csv?alt=media&token=9f8376e1-b66a-46be-86c0-bddfae3b42c9>" %}

{% file src="<https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2F9U0LfQ2EytO0kUrwU9IK%2Fsourcemode.csvpaths?alt=media&token=0fb4f1f1-dfec-4cd7-b037-cbb6c3d54608>" %}

{% file src="<https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2FUNGYqCmSVtUQfasBc03H%2Fsourcemode2.csvpaths?alt=media&token=6da5b6ec-f03f-400d-8ca7-f7f849023f78>" %}

You stage the data and load the csvpaths like this:&#x20;

<div><figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2FGVSsApng9x7WXpcX7vPB%2FScreenshot%202025-02-13%20at%203.00.26%E2%80%AFPM.png?alt=media&#x26;token=583afaf1-4c99-4099-bfd0-29a8a1fc2291" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2FTLoTUtUE7ejtGeWFlJbC%2FScreenshot%202025-02-13%20at%203.00.34%E2%80%AFPM.png?alt=media&#x26;token=a8cb6fe9-e2e6-4110-b34a-ab2ecc11b8b1" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2FpFaPHaRYjpCwlGJjZK5c%2FScreenshot%202025-02-13%20at%203.00.58%E2%80%AFPM.png?alt=media&#x26;token=a2224285-78c0-4a28-b253-e657c61ec0ff" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2Fe0N6Ft8opLIrHhTRgcVx%2FScreenshot%202025-02-13%20at%203.01.05%E2%80%AFPM.png?alt=media&#x26;token=c8b15d77-0806-4f2c-99ef-dc5c01130fce" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2FJKr078z0CqneGCxY906x%2FScreenshot%202025-02-13%20at%203.01.12%E2%80%AFPM.png?alt=media&#x26;token=f171c257-4640-4fb2-b2bc-ee6370be8ad8" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2Fmhh7nxVnnOdLdpbi5OkV%2FScreenshot%202025-02-13%20at%203.01.18%E2%80%AFPM.png?alt=media&#x26;token=a2cb6ff3-108d-4857-a756-555cb7aed278" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2FNzvZi9KZKVApjuSOsDDY%2FScreenshot%202025-02-13%20at%203.01.32%E2%80%AFPM.png?alt=media&#x26;token=cff79ca3-d686-4d3f-8979-970dd682c40a" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2F3L7qjKoX83YMU8ewTNum%2FScreenshot%202025-02-13%20at%203.01.39%E2%80%AFPM.png?alt=media&#x26;token=0a8f2853-06b8-400a-944a-4302b092e394" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2FFMR7hkYGoX88uOvceswF%2FScreenshot%202025-02-13%20at%203.01.52%E2%80%AFPM.png?alt=media&#x26;token=09669b38-280b-4986-b096-c7873c88bb58" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2FBSbsTVFVu0bnppNTZCca%2FScreenshot%202025-02-13%20at%203.02.00%E2%80%AFPM.png?alt=media&#x26;token=2a730996-8a88-4d1a-995c-9b6059432408" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2Fp2b7xl05g4FJWoizeqs4%2FScreenshot%202025-02-13%20at%203.02.09%E2%80%AFPM.png?alt=media&#x26;token=1921d29b-3665-4f6d-8819-e2555bf7284f" alt=""><figcaption></figcaption></figure></div>

Next, run the original from `sourcemode.csvpaths`. We're using the version where the `source2` csvpath has the word `working`. Here are the steps:

<div><figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2F0OXCKaLjcpBScnGWNeNX%2FScreenshot%202025-02-13%20at%203.02.19%E2%80%AFPM.png?alt=media&#x26;token=5f80775a-bd28-4bed-a5b8-3364698ff731" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2F6TXQuNubu9jwUsr6uKH2%2FScreenshot%202025-02-13%20at%203.02.27%E2%80%AFPM.png?alt=media&#x26;token=90b000c0-56f2-46f0-9203-1796ef160a3d" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2FzpnYfRd4xnGC4Xbgui2N%2FScreenshot%202025-02-13%20at%203.02.36%E2%80%AFPM.png?alt=media&#x26;token=c4155938-c3c1-4cc2-a565-a74ae74d931d" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2FVdw350Wazg5exPspJgi0%2FScreenshot%202025-02-13%20at%203.02.44%E2%80%AFPM.png?alt=media&#x26;token=ddab18e6-8477-4704-b6ad-4e26579c9b88" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2FiRf776nuc89QA1Qo7UrS%2FScreenshot%202025-02-13%20at%203.02.54%E2%80%AFPM.png?alt=media&#x26;token=220e463b-bd96-4c8d-a05c-734bb7b612f9" alt=""><figcaption></figcaption></figure></div>

The result is a bit messy, but if you look closely those printouts tell us the csvpaths worked. Anyway, the `print()` statements in the csvpaths can be removed when you want to show off this trick to your friends.

Running a rewind/replay in the CLI is easy. But remember to reload your csvpaths when you make changes. We have a second csvpaths file that has our changes, so load it now. Use the same named-paths name as you did the first time.&#x20;

Now we're ready to rewind and replay using the same data generated by the `source1` csvpath with the new csvpaths. The new csvpaths file is only different in the `source2` and `source3` csvpaths, so we're going to start with `source2`:&#x20;

<div><figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2FmS3GQM1jJxWHg5QRfka2%2FScreenshot%202025-02-13%20at%203.04.06%E2%80%AFPM.png?alt=media&#x26;token=3d3be8a1-33c5-423c-8bcb-7be69dc9dc3d" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2Frys0tRMy7agQ377R5O33%2FScreenshot%202025-02-13%20at%203.04.16%E2%80%AFPM.png?alt=media&#x26;token=00604793-6ab7-4277-ab62-ffa0cad85121" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2FSE7MOgbNFcIebBiI1zgx%2FScreenshot%202025-02-13%20at%203.04.25%E2%80%AFPM.png?alt=media&#x26;token=2d57a17c-01e4-47a6-b462-63c1817dcb67" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2Fi9gTMQzoHyxmMJJspy2t%2FScreenshot%202025-02-13%20at%203.04.34%E2%80%AFPM.png?alt=media&#x26;token=19431779-5e6c-4dc7-8443-e7b9ed353e90" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2Fas7U2ND12T52j3T6VHvj%2FScreenshot%202025-02-13%20at%203.04.45%E2%80%AFPM.png?alt=media&#x26;token=f9c5d966-f0f3-49f5-9f5b-8d06f06b6182" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2FRwyy3jrCVPKzQC12Fg99%2FScreenshot%202025-02-13%20at%203.04.55%E2%80%AFPM.png?alt=media&#x26;token=2f75d581-acc7-4cca-9dfd-1c7430526215" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2FGQETCHYe975JvDygHHiW%2FScreenshot%202025-02-13%20at%203.05.05%E2%80%AFPM.png?alt=media&#x26;token=17a23aea-656f-4b75-bc9c-df7732a23b41" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2F0TPEFBWKGOKkQYVlndRd%2FScreenshot%202025-02-13%20at%203.05.13%E2%80%AFPM.png?alt=media&#x26;token=c42065cf-da0d-4d22-b822-1ef1df1f5667" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2F0HckihsWb6uYbC4zoYp9%2FScreenshot%202025-02-13%20at%203.05.22%E2%80%AFPM.png?alt=media&#x26;token=e8eb4637-1e83-459c-bbdc-70038f13cde9" alt=""><figcaption></figcaption></figure> <figure><img src="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2FmrlUQjmkBmK0UGbcxwfK%2FScreenshot%202025-02-13%20at%203.05.35%E2%80%AFPM.png?alt=media&#x26;token=74ec9ff5-204d-4001-ab13-9ea8c5512f5b" alt=""><figcaption></figcaption></figure></div>

And there again we did the substitution of `thinking` for `working`. &#x20;

You can see that rewind/replay based on immutable data is straightforward — using the CLI or Python. If you need to redo any part of your process and you don't want to start at the very beginning, you have an easy way to do that. And because the data is immutable and the processing is idempotent, there is little risk in iterating on a solution. Using the CLI, if you prefer that approach, is just icing on the cake.

Here's a quick video to show the steps we took. Try it yourself.

&#x20;

{% embed url="<https://youtu.be/4mP4gbqe0rw>" %}
