05-04-2012
Hi, yang lei, everything in awk has the form condition{action} . If the condition evaluates to 1 then the action is performed. If the condition is omitted then the default condition is 1, so the action is always performed. If the action is omitted then the default action is performed, which is {print $0} . In this case the condition is "1" so that evaluates to 1 and the action is omitted, therefore {print $0} is performed, which is "print the entire record".
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi guys, I hope you can help me with my problem.
I have a text file that contains lines like this:
78 ANGELO -809.05
79 ANGELO2 -5,000.06
I need to find all occurences of amounts that are negative and replace them with x's
78 ANGELO xxxxxxx
79... (4 Replies)
Discussion started by: amangeles
4 Replies
2. UNIX for Dummies Questions & Answers
Please can anyone tell me, how to count the string length (2 Replies)
Discussion started by: Anshu
2 Replies
3. Shell Programming and Scripting
Hello All,
Plz help me with:
I have a csv file with data separated by ',' and optionally enclosed by "". I want to check each of these values to see if they exceed the specified string length, and if they do I want to cut just that value to the max length allowed and keep the csv format as it... (9 Replies)
Discussion started by: ozzy80
9 Replies
4. UNIX for Dummies Questions & Answers
Hi
lets say i have a variable
output="string"
how can you find the length of the string contained in this variable? i guess "wc" cannot be used. its only for files. (8 Replies)
Discussion started by: silas.john
8 Replies
5. UNIX for Dummies Questions & Answers
HI
In my script, i am reading the input from the user and want to find the length of the string.
The input may contain leading spaces. Right now, when leading spaces are there, they are not counted.
Kindly help me
My script is like below. I am using the ksh.
#!/usr/bin/ksh
echo... (2 Replies)
Discussion started by: dayamatrix
2 Replies
6. Shell Programming and Scripting
I am trying to write a shell scrip that can give me the line length of a record that was in EBDIC and then converted to ASCII. Everything I try reports 1 yet the length is 2000+. I have tried
echo "Line length : ${#FILE}"
echo "FILE" |awk -F, '{print NF}'
awk '{lenth(file)}'
All I can... (11 Replies)
Discussion started by: wbshrk
11 Replies
7. Shell Programming and Scripting
Morning, every one.
I have a file like this:
AAEQGAGNQPQH 27
AAGETQY 51
AAGGSSYNEQF 12
AAGGYEQY 72
AAGLEAKNIQY 159
AAGPYEQY 26
AAGQDYNSPLH 45
AAGQGGEQF 1587
AAGREGGNTEAF 4
AAGSPQH 3
AAGSYEQY 45
AAGTGAYEQY 19
AAGTSGNNEQF 79
AAGWNTEAF 37
I want to count the string length of the... (2 Replies)
Discussion started by: xshang
2 Replies
8. UNIX for Dummies Questions & Answers
I want to get count on number of records in a few folders by running grep command for more than two columns in a row of fixed length file.
suppose if i have a fixed length file has 5 columns and I want to see the record counts for country =can and province = bc and time stamp <= 12 feb 2013... (14 Replies)
Discussion started by: princetd001
14 Replies
9. Shell Programming and Scripting
I have a large dataset with following structure;
C 0001 Carbon
D SAR001 methane
D SAR002 ethane
D SAR003 propane
D SAR004 butane
D SAR005 pentane
C 0002 Hydrogen
C 0003 Nitrogen
C 0004 Oxygen
D SAR011 ozone
D SAR012 super oxide
C 0005 Sulphur
D SAR013... (3 Replies)
Discussion started by: Syeda Sumayya
3 Replies
10. UNIX for Beginners Questions & Answers
I could calculate the length of entire fasta sequences by following command,
awk '/^>/{if (l!="") print l; print; l=0; next}{l+=length($0)}END{print l}' unique.fasta
But, I need to calculate the length of a particular fasta sequence specified/listed in another txt file. The results to to be... (14 Replies)
Discussion started by: dineshkumarsrk
14 Replies
LEARN ABOUT HPUX
dtactionlabel
DtActionLabel(library call) DtActionLabel(library call)
NAME
DtActionLabel -- get the localizable label string for an action
SYNOPSIS
#include <Dt/Action.h>
char *DtActionLabel(
char *actionName);
DESCRIPTION
The DtActionLabel function provides access to the localizable label string associated with an action named actionName. The actionName argu-
ment is the name of the action. The localizable label string is the string that all components should display to identify the action. If
the action definition does not specify a label string, the action name itself is returned.
The label string associated with an action is localizable, but the action name is not.
If there are multiple actionName actions, the label string returned is the label associated with the most general action. The most general
action is the one with the lowest precedence, as described in dtactionfile(4) (``Action Selection'').
RETURN VALUE
Upon successful completion, the DtActionLabel function returns a newly allocated copy of the localizable label string associated with the
action if an action named actionName is found; otherwise, it returns NULL. It is up to the caller to free the memory associated with this
new copy of the label. The default value for an action label is the action name itself.
APPLICATION USAGE
All applications displaying action names should use the action label to identify an action.
SEE ALSO
Dt/Action.h - DtAction(5), dtactionfile(4), dtdtfile(4).
DtActionLabel(library call)