08-16-2013
Hi RudiC,
Thanks for your help, but your command returns also text that's between the required strings. Somehow it does pick strings that are not required.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Can some body tell me how to print number of line from a particular file, with sed. ?
Input file format
AAAA
BBBB
CCCC
SDFFF
DDDD
DDDD
Command to print line 2 and 3 ?
BBBB
CCCC
And also please tell me how to assign column sum to variable.
I user the following command it... (1 Reply)
Discussion started by: maheshsri
1 Replies
2. Shell Programming and Scripting
Hi,
I want to print only lines in between two strings and not the strings using awk.
Eg:
OUTPUT
top 2
bottom 1
left 0
right 0
page 66
END
I want to print into a new file only
top 2
bottom 1
left 0... (4 Replies)
Discussion started by: jisha
4 Replies
3. Shell Programming and Scripting
abc.dat
tty cpu
tin tout us sy wt id
0 0 7 3 19 71
extended device statistics
r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device
0.0 133.2 0.0 682.9 0.0 1.0 0.0 7.2 0 79 c1t0d0
0.2 180.4 0.1 5471.2 3.0 2.8 16.4 15.6 15 52 aaaaaa1-xx
I want to skip first 5 line... (4 Replies)
Discussion started by: kchinnam
4 Replies
4. UNIX for Dummies Questions & Answers
Ok so I can use awk to match a pattern and print the whole line with print $0. Is there any way to just tell awk to print every line of output when the pattern matches?
I'm having it wait for the word error and then print that entire line. But what I actually need to see is all the following... (9 Replies)
Discussion started by: MrEddy
9 Replies
5. Shell Programming and Scripting
Dear All,
a.txt
A 1 Z
A 1 ZZ
B 2 Y
B 2 AA
how can i use awk one line to achieve the result:
A Z|ZZ
B Y|AA
Thanks (5 Replies)
Discussion started by: jimmy_y
5 Replies
6. Shell Programming and Scripting
I have a file1.txt
file1.txt
F-120009210","Felix","U-M-F-F-F-","white","yes","no","U-M-F-F-F-","Bristol","RI","true"
F-120009213","Fluffy","U-F-","white","yes","no","M-F-","Warwick","RI","true"
U-120009217","Lity","U-M-","grey","yes","yes","","Fall River","MA","true"... (4 Replies)
Discussion started by: charles33
4 Replies
7. Shell Programming and Scripting
I have a output log file, that I want to extract some temperature measurement data.
I want to AWK on the words "show chassis environment" in the original file, and extract that entire line, and then the 3rd to 10th lines after the one I AWK'd, into a seperate output file.
Here is an example... (3 Replies)
Discussion started by: HikerLT
3 Replies
8. Shell Programming and Scripting
im using the code below to monitor a file:
gawk '{
a += gsub("(^| )accepted( |$)", "&")
a += gsub("(^| )open database( |$)", "&")
} END {
for (i in a)
printf("%s=%s\n", i, a)
}' /var/log/syslog
the code is searching the syslog file for the string "accepted" and "open... (2 Replies)
Discussion started by: SkySmart
2 Replies
9. UNIX for Dummies Questions & Answers
URGENT HELP IS NEEDED!!
I am looking to move matching lines (01 - 07) from File1 and 77 tab the matching string from File2, to File3.txt. I am almost done but
- Currently, script is not printing lines to File3.txt in order.
- Also the matching lines are not moving out of File1.txt
... (1 Reply)
Discussion started by: High-T
1 Replies
10. Shell Programming and Scripting
from the CLI on a Mac, if you type networksetup -listallnetworkservices then you get results in a multi-line paragraph that look something like this:
networksetup -listallnetworkservices
An asterisk (*) denotes that a network service is disabled.
Wi-Fi
Display Ethernet
Bluetooth DUN... (7 Replies)
Discussion started by: hungryd
7 Replies
mkmsgs(1) User Commands mkmsgs(1)
NAME
mkmsgs - create message files for use by gettxt
SYNOPSIS
mkmsgs [-o] [-i locale] inputstrings msgfile
DESCRIPTION
The mkmsgs utility is used to create a file of text strings that can be accessed using the text retrieval tools (see gettxt(1), srchtxt(1),
exstr(1), and gettxt(3C)). It will take as input a file of text strings for a particular geographic locale (see setlocale(3C)) and create a
file of text strings in a format that can be retrieved by both gettxt(1) and gettxt(3C). By using the -i option, you can install the cre-
ated file under the /usr/lib/locale/locale/LC_MESSAGES directory (locale corresponds to the language in which the text strings are writ-
ten).
inputstrings is the name of the file that contains the original text strings. msgfile is the name of the output file where mkmsgs writes
the strings in a format that is readable by gettxt(1) and gettxt(3C). The name of msgfile can be up to 14 characters in length, but may not
contain either (null) or the ASCII code for / (slash) or : (colon).
The input file contains a set of text strings for the particular geographic locale. Text strings are separated by a newline character. Non-
graphic characters must be represented as alphabetic escape sequences. Messages are transformed and copied sequentially from inputstrings
to msgfile. To generate an empty message in msgfile, leave an empty line at the correct place in inputstrings.
Strings can be changed simply by editing the file inputstrings. New strings must be added only at the end of the file; then a new msgfile
file must be created and installed in the correct place. If this procedure is not followed, the retrieval function will retrieve the wrong
string and software compatibility will be broken.
OPTIONS
The following options are supported:
-o Overwrite msgfile, if it exists.
-i locale Install msgfile in the /usr/lib/locale/locale/LC_MESSAGES directory. Only someone who is super user or a member of group
bin can create or overwrite files in this directory. Directories under /usr/lib/locale will be created if they do not
exist.
EXAMPLES
Example 1: Using the mkmsgs command.
The following example shows an input message source file C.str:
File %s: cannot be opened
%s: Bad directory
.
.
.
write error
.
.
Example 2: Using Input Strings From C.str to Create Text Strings in a File
The following command uses the input strings from C.str to create text strings in the appropriate format in the file UX in the current
directory:
example% mkmsgs C.str UX
Example 3: Using Input Strings From FR.str to Create Text Strings in a File
The following command uses the input strings from FR.str to create text strings in the appropriate format in the file UX in the directory
/usr/lib/locale/fr/LC_MESSAGES:
example% mkmsgs -i fr FR.str UX
These text strings would be accessed if you had set the environment variable LC_MESSAGES=fr
and then invoked one of the text retrieval tools listed at the beginning of the DESCRIPTION section.
FILES
/usr/lib/locale/locale/LC_MESSAGES/*
message files created by mkmsgs
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|Availability |SUNWloc |
+-----------------------------+-----------------------------+
SEE ALSO
exstr(1), gettxt(1), srchtxt(1), gettxt(3C), setlocale(3C), attributes(5)
SunOS 5.10 26 Jul 1994 mkmsgs(1)