If you are convinced that the 3 digit substrings in "$decimalstring" are in the range 0 through 255, the loop should run faster if you replace the two if statements with:
Have you compared the speed of $[ ( m + 1 ) ] versus $((m+1))?
This User Gave Thanks to Don Cragun For This Post:
Hello,
I have a korn shell string variable
str1 = "A,B,Z"
I would like to create another korn shell string variable
str2 = "letter = 'A' or letter = 'B' or letter = 'Z' "
Please help!
Thanks in advance
an UNIX newbie! (13 Replies)
Hey Guys,
Right i know how to alter a word to begin with a capital letter, i know how to remove unwanted characters and replace them with the relevant character however i don't now if there is a way to do them all in one line.
Code:
echo -n ${string:0:1} | tr a-z A-Z #convert first letter... (4 Replies)
i have a file that contains a pattern like this:
ajay 1234 newyork available
kumar 2345 denver
singh 2345 newyork
ajay 3456 denver
kumar 3456 newyork
singh 3456 delhi available
ajay 4567 miami
kumar 4567 miami
singh 4567 delhi
i want to search for each line... (5 Replies)
if I have two string variable, how do I add one to anther.
like
a= "a"
b="b"
c=$a+$b
but that doesn't work.
Is there anyway to solve it.http://www.qtl.co.il/img/copy.pnghttp://www.google.com/favicon.icohttp://www.babylon.com/favicon.icohttp://www.morfix.com/favicon.ico (2 Replies)
Hi Guru's,
I need some help with data manipulation using shell scripting. I know how to replace the whole string but not part of the string.
The value after aa= should be replaced with the value in the mail leaving ,OU=111,OU=222,DC=333 as is. Below are the inputs and expected outputs.
Input:... (17 Replies)
Hi,
I have the followoing details in one file:
opt/tra/domain/test/new/filename1
training/ear/help
I need to manipulate the string in the following manner:
filename1= opt/tra/domain/test/new/filename1
help=training/ear/help
last string is the name and equal sign and then... (2 Replies)
i have something like this...
echo "teCertificateId" | awk -F'Id' '{ print $1 }' | awk -F'te' '{ print $2 }'
Certifica
the awk should remove 'te' only if it is present at the start of the string.. anywhere else it should ignore it.
expected output is
Certificate (7 Replies)
Hi ,
I am getting a string like
aaa,bbb,sdsdad,sdfsdf,sdfsdfdsf,rtyrtyr,45654654,ddfdfdfgdfg,dfgdfgdg...........
Now what I need is to format it.
So after each nth comma I need one newline. So the above will look like
when n=3
aaa,bbb,sdsdad,
sdfsdf,sdfsdfdsf,rtyrtyr,... (4 Replies)
I'm making a little game in Perl, and I am trying to remove the first instance of a character in an arbitrary string. For example, if the string is
"cupcakes"and the user enters another string that contains letters from "cupcake" e.g:
"sake"the original string will now look like this (below)... (3 Replies)
i have a string that am looking to extract all characters following 3 consecutiv numbers.
Example my string is J1705PEAN038TDMN, i need to get TDMN
My string can have multiple 3 consecutive numbers, i need what follows last occurance (9 Replies)
Discussion started by: gigagigosu
9 Replies
LEARN ABOUT DEBIAN
grd2xyz
GRD2XYZ(l) GRD2XYZ(l)
NAME
grd2xyz - Converting a grdfile to an ASCII or binary table
SYNOPSIS
grd2xyz grdfile [ -H[nrec] ] [ -L ] [ -Rwest/east/south/north[r] [ -S[r ] [ -V ] [ -Z[flags] ] [ -bo[s][n] ]
DESCRIPTION
grd2xyz reads a binary 2-D grdfile and writes out xyz-triplets in ASCII [or binary] format to standard output. Modify the precision of the
ASCII output format by editing the D_FORMAT parameter in your .gmtdefaults file, or choose binary output using single or double precision
storage. As an option you may output z-values without the (x,y) in a number of formats, see -Z below.
grdfile
The 2-D binary file to be converted.
OPTIONS -H Output 1 header record based on information in the grdfile header. Ignored if binary output is selected. [Default is no header].
-L Indicates that the x values are longitudes (necessary for -: to work).
-R west, east, south, and north specify the Region of interest. To specify boundaries in degrees and minutes [and seconds], use the
dd:mm[:ss] format. Append r if lower left and upper right map coordinates are given instead of wesn.
-S Suppress output for nodes whose z-value equals NaN [Default outputs all nodes]. Append r to reverse the suppression, i.e., only
output the nodes whose z-value equals NaN.
-V Selects verbose mode, which will send progress reports to stderr [Default runs "silently"].
-Z Write a 1-column ASCII [or binary] table. Output will be organized according to the specified ordering convention contained in
flags. If data should be written by rows, make flags start with T(op) if first row is y = ymax or B(ottom) if first row is y =
ymin. Then, append L or R to indicate that first element should start at left or right end of row. Likewise for column formats:
start with L or R to position first column, and then append T or B to position first element in a row. For gridline registered
grids: If grid is periodic in x but the outcoming data should not contain the (redundant) column at x = xmax, append x. For grid
periodic in y, skip writing the redundant row at y = ymax by appending y. If the byte-order needs to be swapped, append w. Select
one of several data types (all binary except a):
a ASCII representation
c signed 1-byte character
u unsigned 1-byte character
h short 2-byte integer
i 4-byte integer
l long (4- or 8-byte) integer
f 4-byte floating point single precision
d 8-byte floating point double precision
Default format is scanline orientation of ASCII numbers: -ZTLa. Note that -Z only applies to 1-column output.
-bo Selects binary output. Append s for single precision [Default is double]. This option only applies to xyz output; see -Z for z ta-
ble output.
EXAMPLES
To edit individual values in the 5' by 5' hawaii_grv.grd file, try
grd2xyz hawaii_grv.grd > hawaii_grv.xyz
To write a single precision binary file without the x,y positions from the file raw_data.grd file, using scanline orientation, try
grd2xyz raw_data.grd -ZTLf > hawaii_grv.b
SEE ALSO gmtdefaults(1gmt), gmt(1gmt), grdedit(1gmt), xyz2grd(1gmt)
1 Jan 2004 GRD2XYZ(l)