09-13-2003
Letters, Numbers or Alphanumerical
How do I check if a variable consisted of letters, numbers or both letters and numbers?
For example, I have a variable $X and I want to print "1" if it contains only letters, "2" if it contains only numbers and "3" if it contains both
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello all I am a unix newbie....
I have a sun netra t1 and it is freaking out
I am connected to it through a console port, and it is just spitting out a ton on numbers and letters like below its just keeps going and going.
I have tried rebooting it and I cannot get it back to any kind of a... (1 Reply)
Discussion started by: intraining11
1 Replies
2. Shell Programming and Scripting
Howdy experts,
We have some ranges of number which belongs to particual group as below.
GroupNo StartRange EndRange
Group0125 935300 935399
Group2006 935400 935476
937430 937459
Group0324 935477 935549
... (6 Replies)
Discussion started by: thepurple
6 Replies
3. Shell Programming and Scripting
If I have a set of strings,
C21
F231
H42
1C10
1F113
and I want to isolate the ints following the char, what would the sed string be to find numbers after letters?
If I do,
*, I will get numbers after letters, but I am looking to do something like,
sed 's/*/\t*/g'
this will give me... (14 Replies)
Discussion started by: LMHmedchem
14 Replies
4. Shell Programming and Scripting
Hi,
I columns with both number and letters however i need the number 4 trimmed off the lines that have 3 numbers in them so it just because the 2 preceding numbers only
For example
V25QG2-K18QG-V25CG2
L26HG-L17HA-L26CG
I434QD1-L19HB2-I434CD1
I434QD1-A31QB-I434CD1 ... (7 Replies)
Discussion started by: olifu02
7 Replies
5. UNIX for Dummies Questions & Answers
Hello all. I am a beginner UNIX user who is using UNIX to work on a bioinformatics project for my university.
I have a bit of a complicated issue in trying to use sed (or awk) to "find and replace" bases (letters) in a genetics data spreadsheet (converted to a text file, can be either... (3 Replies)
Discussion started by: Mince
3 Replies
6. Shell Programming and Scripting
Hi Experts,
I am finding difficulty to get exact match:
file
OPERATING_SYSTEM=HP-UX
LOOPBACK_ADDRESS=127.0.0.1
INTERFACE_NAME="lan3"
IP_ADDRESS="10.53.52.241"
SUBNET_MASK="255.255.255.192"
BROADCAST_ADDRESS=""
INTERFACE_STATE=""
DHCP_ENABLE=0
INTERFACE_NAME="lan3:1"... (6 Replies)
Discussion started by: rveri
6 Replies
7. Shell Programming and Scripting
Hello,
I have a file such as this:
chr1
chr2
chr1
chr2
chr3
chr10
chr4
chr5
chrz
chr1AI want to sort it, I use this command:
sort -k1 -th -n testfilebut I get this output, how can I fix this?
chr1
chr1
chr10
chr1A
chr2
chr2 (3 Replies)
Discussion started by: Homa
3 Replies
8. UNIX for Dummies Questions & Answers
I have a file with hundreds of lines in it. I wanted to extract anything that matches the following:
KR followed by 4 digits:
example KR1201
cat list | sed "s///g"
Is the closest I've come, and obviously it is not what I want. This would remove all of the items that I want and leave me... (2 Replies)
Discussion started by: newbie2010
2 Replies
9. Shell Programming and Scripting
Heyas
Just a little fun script (code block) i'd like to share for fun.
#/bin/bash
# roman.sh
#
# Function
#
num2roman() { # NUM
# Returns NUM in roman letters
#
input=$1 # input num
output="" # Clear output string
len=${#input} # Initial length to count down
... (9 Replies)
Discussion started by: sea
9 Replies
10. UNIX for Beginners Questions & Answers
Hi!
I found and then adapt the code for my pipeline...
awk -F"," -vOFS="," '{printf "%0.2f %0.f\n",$2,$4}' xxx > yyy
I add -F"," -vOFS="," (for input and output as csv file) and I change the columns and the number of decimal...
It works but I have also some problems... here my columns
... (7 Replies)
Discussion started by: echo manolis
7 Replies
refer(1) User Commands refer(1)
NAME
refer - expand and insert references from a bibliographic database
SYNOPSIS
refer [-ben] [-ar] [-cstring] [-kx] [-lm,n] [-p filename] [-skeys] filename...
DESCRIPTION
refer is a preprocessor for nroff(1), or troff(1), that finds and formats references. The input files (standard input by default) are
copied to the standard output, except for lines between `.[' and `.]' command lines, Such lines are assumed to contain keywords as for
lookbib(1), and are replaced by information from a bibliographic data base. The user can avoid the search, override fields from it, or add
new fields. The reference data, from whatever source, is assigned to a set of troff strings. Macro packages such as ms(5) print the fin-
ished reference text from these strings. A flag is placed in the text at the point of reference. By default, the references are indicated
by numbers.
When refer is used with eqn(1), neqn, or tbl(1), refer should be used first in the sequence, to minimize the volume of data passed through
pipes.
OPTIONS
-b Bare mode -- do not put any flags in text (neither numbers or labels).
-e Accumulate references instead of leaving the references where encountered, until a sequence of the form:
.[
$LIST$
.]
is encountered, and then write out all references collected so far. Collapse references to the same source.
-n Do not search the default file.
-ar Reverse the first r author names (Jones, J. A. instead of J. A. Jones). If r is omitted, all author names are reversed.
-cstring Capitalize (with SMALL CAPS) the fields whose key-letters are in string.
-kx Instead of numbering references, use labels as specified in a reference data line beginning with the characters %x; By
default, x is L.
-lm,n Instead of numbering references, use labels from the senior author's last name and the year of publication. Only the first
m letters of the last name and the last n digits of the date are used. If either of m or n is omitted, the entire name or
date, respectively, is used.
-p filename Take the next argument as a file of references to be searched. The default file is searched last.
-skeys Sort references by fields whose key-letters are in the keys string, and permute reference numbers in the text accordingly.
Using this option implies the -e option. The key-letters in keys may be followed by a number indicating how many such
fields are used, with a + sign taken as a very large number. The default is AD, which sorts on the senior author and date.
To sort on all authors and then the date, for instance, use the options `-sA+T'.
FILES
/usr/lib/refer directory of programs
/usr/lib/refer/papers directory of default publication lists and indexes
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWdoc |
+-----------------------------+-----------------------------+
SEE ALSO
addbib(1), eqn(1), indxbib(1), lookbib(1), nroff(1), roffbib(1), sortbib(1), tbl(1), troff(1), attributes(5)
SunOS 5.10 14 Sep 1992 refer(1)