Skip to main content
1-Visitor
Dec 18, 2014 5:59 PM UTC
Question

Reading ground motion data from txt file

Hello

I want to import the ground motion data from txt file. I have to escape first few lines of text in txt file then, read only the numeric value.

Could you guide me how can I do it?

Regards,

Keshab

4 replies

24-Ruby IV
Dec 18, 2014 6:58 PM UTC

You can use the following built-in functions:

  • READPRN("file") - returns an array containing the contents of the ASCII file;
  • READFILE("file", "type", [colwidths], [rows], [cols], [emptyfill]) - returns an array containing the data in file.

You can find more information about the work of these functions in the "Mathcad Help" file (key F1😞

Pic_1.png

P.S. For the future - for new questions create a new discussion please.

Translate
1-Visitor
Dec 18, 2014 7:31 PM UTC

Go to insert>component>import wizard

choose delimited text in the box and browse for your text file. you will see choices for starting row, range of columns and rows to read and so on. once all you want is selected, you come out of the box and give a name to the data.

amit

Translate
ksharma-21-VisitorAuthor
1-Visitor
Dec 18, 2014 7:35 PM UTC

I think there is no inset tab/menu in MathCAD Prime 3.0

Translate
24-Ruby IV
Dec 19, 2014 6:26 PM UTC

If you work with Mathcad Prime 3.0 you can use Excel component:

All Mathcad Prime video tutorials: http://learningexchange.ptc.com/tutorials/by_sub_product/ptc-mathcad-prime/sub_product_id:19?lang=en

Translate