<p>When working on a project with many sound files it is often helpful to open them all into a single sound window. This practice leads to a number of efficiencies, one being that you can put your selections into a single selection table. It can be easier to add measurements (or do statistical analyses) on one selection table than hundreds of selection tables.</p>
<p>If you want to keep track of where your selections are relative to each sound file, add the Begin File, Begin Path, and/or File Offset measurements to your selection table.</p>
<p>Use of the <a href="https://ravensoundsoftware.com/knowledge-base/real-clock-times/" rel="noreferrer">Real Clock Time</a> feature facilitates reporting the exact date and time of sound events as well as navigating quickly to a specific dates and times in your recording.</p>
<p>When opening hours of audio into a single sound window in Raven it is advisable to used paged sound views (as described in Chapter 7 of the <a href="https://ravensoundsoftware.com/wp-content/uploads/2017/11/Raven14UsersManual.pdf" rel="noreferrer">Raven Pro User's Manual</a>) to avoid memory management issues.</p>

CC BY-SA 4.0
2022-08-15T04:53:28.700Z
2022-08-15T04:53:28.700Z
Michael Pitzrick
<p>Following on the comments,</p>
<p>If you have the &quot;File Offset&quot;  + the &quot;Begin Path&quot; measurements you can reopen a selection table as a &quot;sound selection table&quot; in Raven and it will automatically load the sound files with selections and the annotation boxes you created in your previous session when you saved the selection table.</p>
<p>To open an existing selection table, you can</p>
<p>(1) Open Raven, hold CTRL and then drag and drop the saved selection table .txt file into the main Raven window</p>
<p>or</p>
<p>(2) Go to File &gt; Sound Open Selection Table.</p>
<p>Then, once the selection table and linked files are reopened in Raven, you can just add measurements like you would have done before! (I typically right-click on the Selection table and use &quot;Choose Measurements&quot; in the pop up menu.</p>
<p>It also sounds like you are working with multiple .txt. files - the approach I outlined is useful if you opened several sound files (into a paged sound window) and saved everything in a single selection table. However, even if you have multiple .txt files, you should be able to merge them just in any text editor, save as a &quot;combined&quot; selection table, and open in Raven to add the measurements you want all at once.</p>

CC BY-SA 4.0
2022-07-08T02:36:50.880Z
Thanks :) I knew about the trick for dragging in selection tables to automatically open the associated sound file. However, this only saves one drag-n-drop per file. 

Merging the txt files and dragging them into Raven wouldn't work unless their associated audio was also there to take the new measurements on (otherwise the selection table rows wouldn't have audio to reference). So I can't picture how that would work unless I merged all of the audio files into one long file too (which is problematic). Unless I've misunderstood...
BirdGuyWes
CC BY-SA 4.0
2022-07-11T18:13:04.747Z
If the "Begin Path" "Begin File" and "File Offset" information is in the selection table, Raven will automatically open the corresponding sound file, or sound files, if multiple files are referenced within a single selection table
selene
CC BY-SA 4.0
2022-08-15T04:33:08.307Z
@selene has a solution that will work. If the selection table has the "Begin Path" and "File Offset" measurement, it can be opened as a "Sound Selection Table". A sound selection table can be opened into the blue field in Raven by

(1) File > Open Sound Selection Table

or

(2) Hold the CTRL key while dragging and dropping into the blue field
Michael Pitzrick
CC BY-SA 4.0
2022-08-15T04:33:45.260Z
When a selection table is opened as a sound selection table, Raven opens all the sound files listed in "Begin Path" and uses the "Begin Path" and "File Offset" fields as the primary time reference to determine selection bounds. It will also overwrite the values in the "Begin Time" and "End Time" fields.

BTW, if you merge several selection tables using a text editor, all the selection tables must have all the same fields in the same order. You must also remove the header line for every selection table except the one in line 1.
Michael Pitzrick
CC BY-SA 4.0
2022-08-15T04:36:56.850Z
As @selene says, if you do this you will have to use paged sound windows to avoid memory management problems. See Chapter 7 in the Raven Pro User's Manual.
Michael Pitzrick
CC BY-SA 4.0
2022-07-07T14:42:32.133Z
2022-08-17T19:24:10.680Z
2022-08-17T19:24:10.680Z
selene
<p>You can use the R package <a href="https://marce10.github.io/Rraven/" rel="nofollow noreferrer">Rraven</a> to pool all the selections in the .txt files together and export that as a single sound selection table that you can then open in Raven. Just make sure that each .txt file has a column with the file name (like &quot;Begin File&quot;). This is what you need to do:</p>
<ol>
<li>Put all the .txt files in the same folder</li>
<li>call <code>imp_raven()</code> to import all those files, using the <code>path</code> argument to tell the function where the .txt files are found</li>
<li>call <code>exp_raven()</code> to export all selections to a single .txt file. This is a sound selection table, so you also need to tell the function where the sound files are found (<code>sound.file.path</code> argument)</li>
<li>Open the new sound selection table in Raven and select the measurement you want to include</li>
</ol>

CC BY-SA 4.0
2022-08-26T18:44:22.953Z
awesome package!
selene
CC BY-SA 4.0
2022-08-26T18:36:46.587Z
2022-08-26T18:36:46.587Z
Marcelo Araya-Salas
<p>As far as I am aware, you will need to reopen every file and add the measurements. :(</p>
<p>However, I have a suspicion this could be automated through Command Prompt and a little bit of regular expressions (regex) and possibly python coding.  If you check out <a href="https://superuser.com/questions/494538/how-do-i-open-a-program-via-the-command-prompt-in-windows-8">this post</a> from SuperUser on how to open a program in regex, it may get you started.  In theory, you should be able to write a loop that opens a program, opens a file and a text file in that program, adds the measurements, saves them, closes them, and then moves on to the next fileset.</p>
<p>Although honestly, I would check in with the Support Team at Raven, and see if they have anything ready to go. Good luck!</p>

CC BY-SA 4.0
2022-07-07T06:03:24.027Z
2022-07-07T06:03:24.027Z
etgriffiths
<p>I have gone through hundreds of recordings in Raven Pro 1.6, taking a suite of measurements on each one. I now have a batch of txt files (Raven selection tables) with the measurements.</p>
<p>Let's say I decide I want to add some measurements. Do I have to open every wav file (and associated txt file selection table) in Raven, add the measurements, re-save the table, and close? Or can I process these in bulk somehow?</p>
<p>Many thanks</p>

CC BY-SA 4.0
2022-07-07T13:43:28.710Z
I had the first two, but not file offset... What would you suggest if I did have all three?
BirdGuyWes
CC BY-SA 4.0
2022-07-07T14:44:10.630Z
Could you put an example line of text from your selection table in your question (showing what measurements you did have already)? Also, did you load a single file at a time, or did you open several files in a single Raven window? I feel like there might be a solution in there somewhere!
selene
CC BY-SA 4.0
2022-07-11T18:13:42.417Z
could you paste an example few lines from your selection output table into your question?
selene
CC BY-SA 4.0
2022-07-07T01:01:15.190Z
Do you have the "Begin Path" and/or the "Begin File" measurement + the "File Offset" measurement already included in these selection tables?
selene
<measurement><raven>
Batch-update Raven selection tables with new measurements?
# Batch-update Raven selection tables with new measurements?

(Asked by: username_0 on 2022-07-07)

I have gone through hundreds of recordings in Raven Pro 1.6, taking a suite of measurements on each one. I now have a batch of txt files (Raven selection tables) with the measurements.

Let's say I decide I want to add some measurements. Do I have to open every wav file (and associated txt file selection table) in Raven, add the measurements, re-save the table, and close? Or can I process these in bulk somehow?

Many thanks

**Tags:** measurement, raven

> **Comments:**
> **username_1**: Do you have the "Begin Path" and/or the "Begin File" measurement + the "File Offset" measurement already included in these selection tables?  
> **username_0**: I had the first two, but not file offset... What would you suggest if I did have all three?  
> **username_1**: Could you put an example line of text from your selection table in your question (showing what measurements you did have already)? Also, did you load a single file at a time, or did you open several files in a single Raven window? I feel like there might be a solution in there somewhere!  
> **username_1**: could you paste an example few lines from your selection output table into your question?  

---

## 4 answers

### Answer by username_2 on 2022-08-15. Score: 6

When working on a project with many sound files it is often helpful to open them all into a single sound window. This practice leads to a number of efficiencies, one being that you can put your selections into a single selection table. It can be easier to add measurements (or do statistical analyses) on one selection table than hundreds of selection tables.

If you want to keep track of where your selections are relative to each sound file, add the Begin File, Begin Path, and/or File Offset measurements to your selection table.

Use of the [Real Clock Time](https://ravensoundsoftware.com/knowledge-base/real-clock-times/) feature facilitates reporting the exact date and time of sound events as well as navigating quickly to a specific dates and times in your recording.

When opening hours of audio into a single sound window in Raven it is advisable to used paged sound views (as described in Chapter 7 of the [Raven Pro User's Manual](https://ravensoundsoftware.com/wp-content/uploads/2017/11/Raven14UsersManual.pdf)) to avoid memory management issues.


---

### Answer by username_1 on 2022-07-07. Score: 4

Following on the comments,

If you have the "File Offset" + the "Begin Path" measurements you can reopen a selection table as a "sound selection table" in Raven and it will automatically load the sound files with selections and the annotation boxes you created in your previous session when you saved the selection table.

To open an existing selection table, you can

(1) Open Raven, hold CTRL and then drag and drop the saved selection table .txt file into the main Raven window

or

(2) Go to File > Sound Open Selection Table.

Then, once the selection table and linked files are reopened in Raven, you can just add measurements like you would have done before! (I typically right-click on the Selection table and use "Choose Measurements" in the pop up menu.

It also sounds like you are working with multiple .txt. files - the approach I outlined is useful if you opened several sound files (into a paged sound window) and saved everything in a single selection table. However, even if you have multiple .txt files, you should be able to merge them just in any text editor, save as a "combined" selection table, and open in Raven to add the measurements you want all at once.

> **Comments:**
> **username_0**: Thanks :) I knew about the trick for dragging in selection tables to automatically open the associated sound file. However, this only saves one drag-n-drop per file.   Merging the txt files and dragging them into Raven wouldn't work unless their associated audio was also there to take the new measurements on (otherwise the selection table rows wouldn't have audio to reference). So I can't picture how that would work unless I merged all of the audio files into one long file too (which is problematic). Unless I've misunderstood...  
> **username_1**: If the "Begin Path" "Begin File" and "File Offset" information is in the selection table, Raven will automatically open the corresponding sound file, or sound files, if multiple files are referenced within a single selection table  
> **username_2**: @username_1 has a solution that will work. If the selection table has the "Begin Path" and "File Offset" measurement, it can be opened as a "Sound Selection Table". A sound selection table can be opened into the blue field in Raven by  (1) File > Open Sound Selection Table  or  (2) Hold the CTRL key while dragging and dropping into the blue field  
> **username_2**: When a selection table is opened as a sound selection table, Raven opens all the sound files listed in "Begin Path" and uses the "Begin Path" and "File Offset" fields as the primary time reference to determine selection bounds. It will also overwrite the values in the "Begin Time" and "End Time" fields.  BTW, if you merge several selection tables using a text editor, all the selection tables must have all the same fields in the same order. You must also remove the header line for every selection table except the one in line 1.  
> **username_2**: As @username_1 says, if you do this you will have to use paged sound windows to avoid memory management problems. See Chapter 7 in the Raven Pro User's Manual.  

---

### Answer by username_3 on 2022-08-26. Score: 3

You can use the R package [Rraven](https://marce10.github.io/Rraven/) to pool all the selections in the .txt files together and export that as a single sound selection table that you can then open in Raven. Just make sure that each .txt file has a column with the file name (like "Begin File"). This is what you need to do:

1. Put all the .txt files in the same folder
2. call `imp_raven()` to import all those files, using the `path` argument to tell the function where the .txt files are found
3. call `exp_raven()` to export all selections to a single .txt file. This is a sound selection table, so you also need to tell the function where the sound files are found (`sound.file.path` argument)
4. Open the new sound selection table in Raven and select the measurement you want to include

> **Comments:**
> **username_1**: awesome package!  

---

### Answer by username_4 on 2022-07-07. Score: 3

As far as I am aware, you will need to reopen every file and add the measurements. :(

However, I have a suspicion this could be automated through Command Prompt and a little bit of regular expressions (regex) and possibly python coding. If you check out [this post](https://superuser.com/questions/494538/how-do-i-open-a-program-via-the-command-prompt-in-windows-8) from SuperUser on how to open a program in regex, it may get you started. In theory, you should be able to write a loop that opens a program, opens a file and a text file in that program, adds the measurements, saves them, closes them, and then moves on to the next fileset.

Although honestly, I would check in with the Support Team at Raven, and see if they have anything ready to go. Good luck!


---

