Assuming that you're using a POSIX conforming shell (such as ksh or bash), the following seems to do what you want:
When the above script is run in a directory containing the files:
the output produced is:
These 3 Users Gave Thanks to Don Cragun For This Post:
hi, im trying to compare two variables in csh to put in an if statement, eg:
set a = $firstnum
set b = $secondnum
if ($a -ge $b) echo $a
But I get an error ("if: Expression syntax"). How can I make csh see my variables as integers?
thanks in advance! (5 Replies)
I'm trying to write an integer to a file using the write() function, but write() requires the parameter to be written to be a const void*.
How would I go about doing this?
also: using itoa() produces a " warning: implicit declaration of function 'itoa' " even though i have #included stdlib.h (2 Replies)
I would like to add 4.7 and 1.2. However I am unable to do this with expr.
Any simple ideas (even using something other than expr)?
Example:
me> expr 4 + 1
5
me> expr 4.7 + 1.2
expr: 0402-046 A specified operator requires numeric parameters. (18 Replies)
Hi all,
Could someone please advise what is the correct syntax for my little script to process a table of values?
The table is as follows:
0.002432 20.827656
0.006432 23.120364
0.010432 25.914184
0.014432 20.442655
0.018432 20.015243
0.022432 21.579517
0.026432 18.886874... (9 Replies)
Wonderful evening to all of you!
My problem has to possible starting points.
Well, not really, but getting to either one is no problem at all.
So i got either a string in the format of "1920x1080" or simply the integers X = 1920 and Y = 1080.
When I am done, I would like to have an output... (5 Replies)
I'm trying to write a bash script to perform basic arithmetic operations but I want to run a comparison on the arguments first to check that they're a number greater than zero.
I want an error to pop up if the arguments args aren't >= 0 so I have:
if ! ]; then
echo "bad number: $1"
fi
... (14 Replies)
Hi,
I am working in bash in Mac OSX, I have following 'input.txt' file:
<INFO> HypoTestTool: >>> Done running HypoTestInverter on the workspace combined
<INFO> HypoTestTool: The computed upper limit is: 11 +/- 1.02651
<INFO> HypoTestTool: expected limit (median) 11
<INFO> HypoTestTool: ... (13 Replies)
This should be a really easy question.
My input file will have a few fields that are strings in the first line, which I will extract and save as variables. The rest of the fields on every line will be integers and floating point numbers. Can awk tell the difference somehow? That is, is there... (5 Replies)
Hy friends, I am newbie to bash scripting, can anyone explain how b=${a/23/BB} # Substitute "BB" for "23". this line converts "b" into string and and "d" into Integer. Thanks in advance (4 Replies)
Hi,
I can't figure out what I'm missing. I'm running a query to see if there are any streams recording on my DVR before starting a scripted update. I'm guessing that it is viewing $VIDEO as a string instead of an int. I've tried everything I saw on google but it still comes back as $VIDEO is... (8 Replies)
Discussion started by: Rhysers
8 Replies
LEARN ABOUT MOJAVE
branch
branch(1rheolef) rheolef-6.1 branch(1rheolef)NAME
branch -- handle a family of fields
SYNOPSIS
branch [options] filename
EXAMPLE
Generates vtk file colection for visualization with paraview:
branch output.branch -paraview
DESCRIPTION
Read and output a branch of finite element fields from file, in field text file format.
INPUT FILE SPECIFICATION -Idir add dir to the RHEOPATH search path. See also geo(2) for RHEOPATH mechanism.
filename
specifies the name of the file containing the input field.
- read field on standard input instead on a file.
-ndigit int
Number of digits used to print floating point values when using the `-geo' option. Default depends upon the machine precision asso-
ciated to the Float type.
OUTPUT AND RENDER SPECIFICATION -extract int
Extract the i-th record in the file. The output is a field or multi-field file format.
-branch
Output on stdout in `.branch' format. This is the default.
-paraview
Generate a collection of vtk files for using paraview.
-vtk Generate a single vtk file with numbered fields.
-gnuplot
Run 1d animation using gnuplot.
-plotmtv
This driver is unsupported for animations.
OTHER OPTIONS -umin float
-umax float
set the solution range for the gnuplot driver. By default this range is computed from the first field of the branch, and this could
be problematic when this field is initialy zero.
-topography filename[.field[.gz]]
performs a tridimensionnal elevation view based on the topographic data.
-proj performs a P1 projection on the fly. This option is useful when rendering P0 data while vtk render requieres P1 description.
-elevation
For two dimensional field, represent values as elevation in the third dimension. This is the default.
-noelevation
Prevent from the elevation representation.
-scale float
applies a multiplicative factor to the field. This is useful e.g. in conjonction with the elevation option. The default value is
1.
-verbose
print messages related to graphic files created and command system calls (this is the default).
-noverbose
does not print previous messages.
-clean clear temporary graphic files (this is the default).
-noclean
does not clear temporary graphic files.
-execute
execute graphic command (this is the default).
-noexecute
does not execute graphic command. Generates only graphic files. This is usefull in conjuction with the -noclean command.
BRANCH FILE FORMAT
The `.branch' file format bases on the `.field' one:
EXAMPLE GENERAL FORM
#!branch #!branch
branch branch
1 1 11 <version> <nfield=1> <nvalue=N>
time u <key> <field name>
#time 3.14 #<key> <key value 1>
#u #<field name>
field <field 1>
..... ....
..... ....
#time 6.28 #<key> <key value N>
#u #<field name>
field <field N>
..... ....
The key name is here time, but could be any string (without spaces). The previous example contains one field at each time step. Labels
appears all along the file to facilitate direct jumps and field and step skips.
The format supports several fields, such as (t,u(t),p(t)), where u could be a multi-component (e.g. a vector) field:
#!branch
branch
1 2 11
time u p
#time 3.14
#u
mfield
1 2
#u0
field
...
#u1
field
...
#p
#time 6.28
...
SEE ALSO geo(2)rheolef-6.1 rheolef-6.1 branch(1rheolef)