# Saving to file with a timestamp

**URL:** <https://www.ruby-forum.com/t/saving-to-file-with-a-timestamp/233188>\
**Category:** GNU Radio\
**Created:** [November 22, 2014, 12:05pm UTC](https://www.ruby-forum.com/t/saving-to-file-with-a-timestamp/233188 "2014-11-22T12:05:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [November 22, 2014, 12:05pm UTC](https://www.ruby-forum.com/t/saving-to-file-with-a-timestamp/233188/1 "2014-11-22T12:05:56Z")

</div>

I have a flowgraph working that I want to use to save data to a file. I  
would like the file name to update each time, ideally with a time stamp  
as  
part of the name. Is this possible directly from GRC of will I need to  
write  
a block?

Mike

---

<div class="post-metadata">

**Author:** ![vh1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/278dde/32.png) [@vh1](https://www.ruby-forum.com/u/vh1)\
**Post date:** [November 22, 2014, 12:16pm UTC](https://www.ruby-forum.com/t/saving-to-file-with-a-timestamp/233188/2 "2014-11-22T12:16:49Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

There’s been a thread on exactly that a few days ago [1].

Short version: maybe there’s something not too complex you can do in  
GRC, but if you want to do something that looks like a program, you  
might just want to program something 😉

Greetings,  
Marcus

[1]

> **[\[Discuss-gnuradio\] GRC,	Recording chunks of spectrum triggered on input](https://lists.gnu.org/archive/html/discuss-gnuradio/2014-11/msg00154.html)**

[2]  
[http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided\_Tutorials](http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorials)

On 11/22/2014 12:04 PM, Mike W. wrote:

> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ Discuss-gnuradio  
> mailing list [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1

iQEcBAEBAgAGBQJUcHBkAAoJEAFxB7BbsDrLB44H/Rb0pvvBHOcbJHndGFaiedaI  
xrfzOAnzrmaqLOK5Qfr1UYLPDvZp+EOIEr5s2/jAQj5jkHkDQz/5/GPenHYqVRN1  
nvrs+QJ70kSGgqDWjg4GAEo/rz1n3pmyqfPmErMi9J5rmcoPep6NA2xCek7SyHzm  
AehN7fwX7L1y2zQMRIit3Q1pFrfzEeojS6KZsGqrJBL1/nMHqAoqU6lawruxtkL1  
NViNr49Dtur6EXwf6ejv/ptMuojUNouMSyqg6s4KXQEu+b3tGPpW7jPRbWiuIzp0  
+GHF6gvt6Ss1KBXkSRWDSqlYpkbl3J/b6/nNqDFmY8iiZjIyCKMt9JYUaN0y72E=  
=AM87  
-----END PGP SIGNATURE-----

---

<div class="post-metadata">

**Author:** ![vh1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/278dde/32.png) [@vh1](https://www.ruby-forum.com/u/vh1)\
**Post date:** [November 22, 2014, 6:12pm UTC](https://www.ruby-forum.com/t/saving-to-file-with-a-timestamp/233188/3 "2014-11-22T18:12:19Z")

</div>

On Sat, Nov 22, 2014 at 6:15 AM, Marcus Müller [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Marcus
> 
> [1]  
> [[Discuss-gnuradio] GRC, Recording chunks of spectrum triggered on input](http://lists.gnu.org/archive/html/discuss-gnuradio/2014-11/msg00154.html)  
> [2]  
> [http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided\_Tutorials](http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorials)

There is the tagged\_file\_sink:

> **[GNU Radio Manual and C++ API Reference: gr::blocks::tagged\_file\_sink Class...](https://www.gnuradio.org/doc/doxygen/classgr_1_1blocks_1_1tagged __file__ sink.html)**

This is an early implementation of using stream tags for controlling  
things  
like this, so you might want to use this as a guide.

Tom

> On 11/22/2014 12:04 PM, Mike W. wrote:
> 
> > I have a flowgraph working that I want to use to save data to a  
> > file. I would like the file name to update each time, ideally with  
> > a time stamp as part of the name. Is this possible directly from  
> > GRC of will I need to write a block?
> > 
> > Mike

---

<div class="post-metadata">

**Author:** ![vh1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/278dde/32.png) [@vh1](https://www.ruby-forum.com/u/vh1)\
**Post date:** [November 22, 2014, 8:20pm UTC](https://www.ruby-forum.com/t/saving-to-file-with-a-timestamp/233188/4 "2014-11-22T20:20:33Z")

</div>

On 11/22/2014 6:04 AM, Mike W. wrote:

> I have a flowgraph working that I want to use to save data to a file. I  
> would like the file name to update each time, ideally with a time stamp  
> as part of the name.

Hey, Mike,

I’ve used this for this same thing-

[http://www.oz9aec.net/index.php/gnu-radio-blog/348-dynamic-file-names-in-gnu-radio-companion](http://www.oz9aec.net/index.php/gnu-radio-blog/348-dynamic-file-names-in-gnu-radio-companion)

Seems like a simple solution for your problem.

Later,  
George

---

<div class="post-metadata">

**Author:** ![vh1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/278dde/32.png) [@vh1](https://www.ruby-forum.com/u/vh1)\
**Post date:** [November 22, 2014, 7:54pm UTC](https://www.ruby-forum.com/t/saving-to-file-with-a-timestamp/233188/5 "2014-11-22T19:54:33Z")

</div>

You can also use some Python string concatenation to add a Timestamp to  
your file name in GRC. GRC is actually quite liberal in what it will "  
allow" you to add in this way.

On Saturday, November 22, 2014, Tom R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > might just want to program something 😉  
> > There is the tagged\_file\_sink:
> 
> > +GHF6gvt6Ss1KBXkSRWDSqlYpkbl3J/b6/nNqDFmY8iiZjIyCKMt9JYUaN0y72E=

–  
Very Respectfully,

Dan CaJacob
