Editing
Guide to madagascar programs
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==sfdd== {| class="wikitable" align="center" cellspacing="0" border="1" ! colspan="4" style="background:#ffdead;" | Convert between different formats. |- ! colspan="4" | sfdd < in.rsf > out.rsf trunc=n line=8 ibm=n form= type= format= |- | ''string '' || '''form=''' || || ascii, native, xdr |- | ''string '' || '''format=''' || || Element format (for conversion to ASCII) |- | ''bool '' || '''ibm=n''' || [y/n] || Special case - assume integers actually represent IBM floats |- | ''int '' || '''line=8''' || || Number of numbers per line (for conversion to ASCII) |- | ''bool '' || '''trunc=n''' || [y/n] || Truncate or round to nearest when converting from float to int/short |- | ''string '' || '''type=''' || || int, float, complex, short, long |} The <tt>sfdd</tt> program is used to change either the form (<tt>ascii</tt>, <tt>xdr</tt>, <tt>native</tt>) or the type (<tt>complex</tt>, <tt>float</tt>, <tt>int</tt>, <tt>char</tt>) of the input dataset. In the example below, we create a plain text (ASCII) file with numbers and then use <tt>sfdd</tt> to generate an RSF file in <tt>xdr</tt> form with <tt>complex</tt> numbers. <pre> bash$ cat test.txt 1 2 3 4 5 6 bash$ echo n1=6 data_format=ascii_int in=test.txt > test.rsf bash$ sfin test.rsf test.rsf: in="test.txt" esize=0 type=int form=ascii n1=6 d1=? o1=? 6 elements bash$ sfdd < test.rsf form=xdr type=complex > test2.rsf bash$ sfin test2.rsf test2.rsf: in="/tmp/test2.rsf@" esize=8 type=complex form=xdr n1=3 d1=? o1=? 3 elements 24 bytes bash$ sfdisfil < test2.rsf 0: 1, 2i 3, 4i 5, 6i </pre> To learn more about the RSF data format, consult the [[Guide to RSF file format| guide to RSF format]].
Summary:
Please note that all contributions to Madagascar are considered to be released under the GNU Free Documentation License 1.3 or later (see
My wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
English
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Getting Madagascar
download
Installation
GitHub repository
SEGTeX
Introduction
Package overview
Tutorial
Hands-on tour
Reproducible documents
Hall of Fame
User Documentation
List of programs
Common programs
Popular programs
The RSF file format
Reproducibility with SCons
Developer documentation
Adding programs
Contributing programs
API demo: clipping data
API demo: explicit finite differences
Community
Conferences
User mailing list
Developer mailing list
GitHub organization
LinkedIn group
Development blog
Twitter
Slack
Tools
What links here
Related changes
Special pages
Page information