# Exporting history data from FLAC3D

**URL:** <https://forum.itascainternational.com/t/exporting-history-data-from-flac3d/1191>\
**Category:** FLAC3D\
**Tags:** tips, suggestions\
**Created:** [September 25, 2023, 6:29pm UTC](https://forum.itascainternational.com/t/exporting-history-data-from-flac3d/1191 "2023-09-25T18:29:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![cgulenc](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@cgulenc](https://forum.itascainternational.com/u/cgulenc)\
**Post date:** [September 25, 2023, 6:29pm UTC](https://forum.itascainternational.com/t/exporting-history-data-from-flac3d/1191/1 "2023-09-25T18:29:28Z")

</div>

Hi,

What is the fastest way of printing history data to a file?

I use the following code but it takes too much time to write a file.

fish define outpiledispdata

loop local iii(1,1480,1)

local PDisX=“PileDx”+string(iii)  
local PDisY=“PileDy”+string(iii)  
local PDisZ=“PileDz”+string(iii)  
local PRoX=“PileRx”+string(iii)  
local PRoY=“PileRy”+string(iii)  
local PRoZ=“PileRz”+string(iii)

command

history export [PDisX] vs “time” skip 1000 table “PDisX”  
history export [PDisY] vs “time” skip 1000 table “PDisY”  
history export [PDisZ] vs “time” skip 1000 table “PDisZ”  
history export [PRoX] vs “time” skip 1000 table “PRoX”  
history export [PRoY] vs “time” skip 1000 table “PRoY”  
history export [PRoZ] vs “time” skip 1000 table “PRoZ”

table “PDisX” export “PileDisX” append  
table “PDisY” export “PileDisY” append  
table “PDisZ” export “PileDisZ” append  
table “PRoX” export “PileRotX” append  
table “PRoY” export “PileRotY” append  
table “PRoZ” export “PileRotZ” append

end\_command

end\_loop

end

---

<div class="post-metadata">

**Author:** ![m.camusso](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@m.camusso](https://forum.itascainternational.com/u/m.camusso)\
**Post date:** [September 26, 2023, 7:05am UTC](https://forum.itascainternational.com/t/exporting-history-data-from-flac3d/1191/2 "2023-09-26T07:05:01Z")

</div>

Just try exporting directly the history to a file without passing through the tables, ie:

history export [PDisX] vs “time” skip 1000 file “PileDisX” truncate

Please also consider to use the keyword “truncate” instead of “append”, so that prexisting files are overwritten.

---

<div class="post-metadata">

**Author:** ![cgulenc](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@cgulenc](https://forum.itascainternational.com/u/cgulenc)\
**Post date:** [September 28, 2023, 7:32am UTC](https://forum.itascainternational.com/t/exporting-history-data-from-flac3d/1191/3 "2023-09-28T07:32:44Z")

</div>

Thank you for the information. I skipped the table part as you recommended but it is still too slow.

I use “append” because I transfer the data for more than one structural element. I add the new data at the end of the previous one thereby piling all data in just one file. Because I am doing it for 1400 pile elements.

---

<div class="post-metadata">

**Author:** ![cgulenc](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@cgulenc](https://forum.itascainternational.com/u/cgulenc)\
**Post date:** [September 29, 2023, 12:00pm UTC](https://forum.itascainternational.com/t/exporting-history-data-from-flac3d/1191/4 "2023-09-29T12:00:28Z")

</div>

**The procedure I followed for data transferring:**

1. 

```
 Before running the analysis,

```

structure node history name “PDisX” displacement-x component-id 1

1. 

```
 After the analysis,

```

history export “PDisX” vs “time” skip XXX file “PileDisX”

Note that item “2” takes too much time. I give the results of my tests for this line as follows:

**Displacement data (in one direction) transferring for the one node of a pile element**

Number of cycles: 1,100,000

Number of data points to be transferred: 110,000

Number of skipped data points: 0

Number of recorded data points: 110,000 (3223KB)

Time elapsed for recording the (11) data points: ≈2 minutes

**Displacement data (in one direction) transferring for the one node of a pile element**

Number of cycles: 1,100,000

Number of data points to be transferred: 110,000

Number of skipped data points: 10,000

Number of recorded data points: 11 (less than 1KB)

Time elapsed for recording the (11) data points: ≈2 minutes

Conclusion:

1. 

```
 Data transferring takes too much time with “history export file” command probably because of

```

2. 

```
 Skipping data points doesn’t give time saving.

```

3. 

```
 I have 1480 nodes. 2min x 1480 ≈49 hours for just one direction displacement output

```

Questions:

1. 

```
 Is there any faster way to transfer data?

```

2. 

```
 Or, how can I improve the data transferring process for time saving?

```

Other info:

1. 

```
 FLAC3D automatically records 2,000 data points per second if I don’t use “skip” command.

```

2. 

```
 I don’t need 2,000 data points per second, 100 data points per second is enough for me.

```

---

<div class="post-metadata">

**Author:** ![cheng](https://avatars.discourse-cdn.com/v4/letter/c/ecccb3/32.png) [@cheng](https://forum.itascainternational.com/u/cheng)\
**Post date:** [September 29, 2023, 6:30pm UTC](https://forum.itascainternational.com/t/exporting-history-data-from-flac3d/1191/5 "2023-09-29T18:30:45Z")

</div>

1. Use a larger interval, et al

> history interval 500

before solving command will reduce the history points for each history.

1. No need to export one history for one command. You can export multiple histories into one file, for example,

> history export [PDisX] [PDisY] [PDisZ] [PRoX] [PRoY] [PRoZ] vs “time” …

---

<div class="post-metadata">

**Author:** ![cgulenc](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@cgulenc](https://forum.itascainternational.com/u/cgulenc)\
**Post date:** [October 2, 2023, 10:13am UTC](https://forum.itascainternational.com/t/exporting-history-data-from-flac3d/1191/6 "2023-10-02T10:13:05Z")

</div>

Thank you very much. Now it is OK.

---

<div class="post-metadata">

**Author:** ![luna](https://avatars.discourse-cdn.com/v4/letter/l/9fc348/32.png) [@luna](https://forum.itascainternational.com/u/luna)\
**Post date:** [October 5, 2023, 2:51am UTC](https://forum.itascainternational.com/t/exporting-history-data-from-flac3d/1191/7 "2023-10-05T02:51:14Z")

</div>

Hi,

Is there a way to export all existing histories to one file, without having to list all of them by name? or somehow dynamically pass a list of histories to export?

Thansk!

---

<div class="post-metadata">

**Author:** ![cheng](https://avatars.discourse-cdn.com/v4/letter/c/ecccb3/32.png) [@cheng](https://forum.itascainternational.com/u/cheng)\
**Post date:** [October 5, 2023, 3:11pm UTC](https://forum.itascainternational.com/t/exporting-history-data-from-flac3d/1191/8 "2023-10-05T15:11:06Z")

</div>

Currently, there is no direct way to export all existing histories to one file without listing them by name or dynamically passing a list of histories to export.

See:  
[history](https://docs.itascacg.com/itasca900/common/docproject/source/manual/scripting/python/doc/itasca.history.html)  
[zone history command](https://docs.itascacg.com/itasca900/flac3d/zone/doc/manual/zone_manual/zone_commands/cmd_zone.history.html)
