The Textpad® text editor is one of many programs that allow for the easy manipulation of text files. It is essential to use a text editor when working with codes versus a word processor, like Microsoft Word® . This is because word processors will embed coding characters within the text that are not visible to the user but will cause issues when the computer attempts to execute them. Within Textpad®, there are numerous features that are not available from simple text editors like NotePad®. One of the most useful features allows the user to highlight a vertical block of text and copy it. This allows the text to be pasted into a spreadsheet for data manipulation. Block select mode is an option under the “Configure” tab in Textpad®. Another useful feature in Textpad® is the macro function . The macro function allows the user to record his or her keystrokes and save them to a macro filename. Then the user can repeat those keystrokes later by selecting the macro tab and clicking on the saved macro filename. Example 2.4 demonstrates how to create a macro that turns rows of numbers in an output file to columns so they can be easily imported into a spreadsheet. This is another option as opposed to using the copy “transpose” function in Microsoft Excel® .
Example 2.4
The ORIGEN output in Example 1.2 displayed the concentrations of isotopes in the following table:
=========================================================================================================================
= Nuclide concentrations in grams for case '1' (#1/1) =
-------------------------------------------------------------------------------------------------------------------------
(relative cutoff; integral of concentrations over time > 1.00E-06 % of integral of all concentrations over time)
.
0.000d 1.000d 7.000d 31.000d 180.000d 365.000d 1095.000d 3285.000d 7300.000d
he-4 0.0000E+00 1.8704E-02 1.8704E-02 1.8707E-02 1.8798E-02 1.9010E-02 2.0073E-02 2.3029E-02 2.7203E-02
pb-206 0.0000E+00 9.1773E-09 2.5772E-06 1.2135E-04 4.8087E-03 1.5761E-02 7.0453E-02 2.2258E-01 4.3733E-01
pb-210 0.0000E+00 9.8117E-01 9.8067E-01 9.7866E-01 9.6627E-01 9.5111E-01 8.9357E-01 7.4101E-01 5.2573E-01
bi-210 0.0000E+00 7.8338E-05 3.7604E-04 5.9696E-04 5.9764E-04 5.8827E-04 5.5268E-04 4.5832E-04 3.2517E-04
po-210 0.0000E+00 5.5325E-06 2.0834E-04 1.8762E-03 9.4834E-03 1.3489E-02 1.5307E-02 1.2654E-02 8.9777E-03
po-214 1.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00
------------
totals 1.0000E+00 9.9996E-01 9.9996E-01 9.9996E-01 9.9996E-01 9.9996E-01 9.9996E-01 9.9973E-01 9.9957E-01
=========================================================================================================================Write a macro in Textpad® to convert the data from rows to columns.
Solution:
Open up Textpad® and copy the table from the ORIGEN output to a new document. Place the cursor on the row beneath the last row on the table. This will indicate the starting position for the macro. When you record the macro, each movement and keystroke will be recorded until you stop.
=========================================================================================================================
= Nuclide concentrations in grams for case '1' (#1/1) =
-------------------------------------------------------------------------------------------------------------------------
(relative cutoff; integral of concentrations over time > 1.00E-06 % of integral of all concentrations over time)
.
0.000d 1.000d 7.000d 31.000d 180.000d 365.000d 1095.000d 3285.000d 7300.000d
he-4 0.0000E+00 1.8704E-02 1.8704E-02 1.8707E-02 1.8798E-02 1.9010E-02 2.0073E-02 2.3029E-02 2.7203E-02
pb-206 0.0000E+00 9.1773E-09 2.5772E-06 1.2135E-04 4.8087E-03 1.5761E-02 7.0453E-02 2.2258E-01 4.3733E-01
pb-210 0.0000E+00 9.8117E-01 9.8067E-01 9.7866E-01 9.6627E-01 9.5111E-01 8.9357E-01 7.4101E-01 5.2573E-01
bi-210 0.0000E+00 7.8338E-05 3.7604E-04 5.9696E-04 5.9764E-04 5.8827E-04 5.5268E-04 4.5832E-04 3.2517E-04
po-210 0.0000E+00 5.5325E-06 2.0834E-04 1.8762E-03 9.4834E-03 1.3489E-02 1.5307E-02 1.2654E-02 8.9777E-03
po-214 1.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00
------------
totals 1.0000E+00 9.9996E-01 9.9996E-01 9.9996E-01 9.9996E-01 9.9996E-01 9.9996E-01 9.9973E-01 9.9957E-01
=========================================================================================================================From the “macro” tab, select “start recording”. Insert a return moving the cursor down one line. Use the arrow keys to move the cursor to the beginning of the first number in the first column. Press and hold the shift key and the right arrow until the first number and the two spaces after it are highlighted. Use the Ctrl –X function to cut the number and the two spaces. Use the arrows to move the cursor back to the newly created line at the bottom of the table and use the Ctrl-V function to paste the value. Now use the arrows to move up to the 2nd number in column one and cut it and paste it next to the first number. Continue cutting and pasting the first column into a row until it looks like the following:
=========================================================================================================================
= Nuclide concentrations in grams for case '1' (#1/1) =
-------------------------------------------------------------------------------------------------------------------------
(relative cutoff; integral of concentrations over time > 1.00E-06 % of integral of all concentrations over time)
.
0.000d 1.000d 7.000d 31.000d 180.000d 365.000d 1095.000d 3285.000d 7300.000d
he-4 1.8704E-02 1.8704E-02 1.8707E-02 1.8798E-02 1.9010E-02 2.0073E-02 2.3029E-02 2.7203E-02
pb-206 9.1773E-09 2.5772E-06 1.2135E-04 4.8087E-03 1.5761E-02 7.0453E-02 2.2258E-01 4.3733E-01
pb-210 9.8117E-01 9.8067E-01 9.7866E-01 9.6627E-01 9.5111E-01 8.9357E-01 7.4101E-01 5.2573E-01
bi-210 7.8338E-05 3.7604E-04 5.9696E-04 5.9764E-04 5.8827E-04 5.5268E-04 4.5832E-04 3.2517E-04
po-210 5.5325E-06 2.0834E-04 1.8762E-03 9.4834E-03 1.3489E-02 1.5307E-02 1.2654E-02 8.9777E-03
po-214 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00
------------
totals 1.0000E+00 9.9996E-01 9.9996E-01 9.9996E-01 9.9996E-01 9.9996E-01 9.9996E-01 9.9973E-01 9.9957E-01
=========================================================================================================================
0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 1.0000E+00Now move the cursor to the starting point and stop recording. Textpad® will then prompt for a name and description. You can then save the macro. Once complete, you can select your macro name under the macro tab, and it will repeat the previous routine by entering a new line and then taking the values from the 2nd column and creating a new row. Once complete, the table can be selected using the block select mode and pasted into a spreadsheet for plotting.
