Extract two strings from a file and create a new file with these strings
I have the following lines in a log file. It would be great if some one can help me to create a new file with the just entries in the below format.
66.150.161.195 HPSAC=Z05
66.150.161.196 HPSAC=A05
That is just extract the IP address and the string DPSAC=its value
Hello fourm members,
I want to write a script to extarct paticular strings from the all type of files(.sh files,logfiles,txtfiles) and redirect into a log file.
example:
I have to find the line below in the script and extract the uname and Pwds.
sqsh -scia2007 -DD0011uw01 -uciadev... (5 Replies)
input file
Desired csv output
gc_type, date/time, milli secs
af, Mar 17 13:09:04 2011, 144.596
af, Mar 20 00:37:37 2011, 144.242
af, ar 20 21:30:59 2011, 108.518
Hi All,
Any help in acheiving the above would be appreciated. I would like to parse through lines within one file and... (5 Replies)
The question is not as simple as the title... I have a file, it looks like this
<string name="string1">RZ-LED</string>
<string name="string2">2.0</string>
<string name="string2">Version 2.0</string>
<string name="string3">BP</string>
I would like to check for duplicate entries of... (11 Replies)
Good afternoon!
I have an XML file from which I want to extract only certain elements contained within each line. The problem is that the format of each line is not exactly the same (though similiar). For example, oa_var will be in each line, however, there may be no value or other... (3 Replies)
Hi,
I have a file say with following lines (the lines could start from any column and there can be many many create statements in the file)
create table table1....table definition...
insert into table1 values.....
create or replace view view1....view definition....
What i want is to... (2 Replies)
Hello guys,
I'm trying to extract all the expressions between the following tags: <b></b> from a HTML file.
This is how it looks: big lines containing several dozens expressions (made of 1,2,3,4,6 or even 7 words) I would like to extract:
<b>bla ble</b>bla ble</td><tr valign="top"><td... (3 Replies)
Hello everybody,
I need to create a file name from string. The thing is:
I have a directory with files e.g:
test.123
test.234
test.345
test.987
The name should be made from the first and last name of file alphabetically and from the directory, they are in, eg.
... (2 Replies)
Dear all,
I have a data like below (n of rows=400,000) and I want to extract the rows with certain strings. I use code below. It works if there is not too many strings for example n of strings <5000. while I have 90,000 strings to extract. If I use the egrep code below, I will get error:
... (3 Replies)
Hello Everyone ,
Iam a newbie to shell programming and iam reaching out if anyone can help in this :-
I have two files
1) Insert.txt
2) partition_list.txt
insert.txt looks like this :-
insert into emp1 partition (partition_name)
(a1,
b2,
c4,
s6,
d8)
select
a1,
b2,
c4, (2 Replies)
I cannot seem to get what should be a simple awk one-liner to work correctly and cannot figure out why. I would like to use patterns from a specific field in one file as regex to search for matching strings in the entire line ($0) of another file.
I would like to output the lines of File2 which... (1 Reply)
Discussion started by: jvoot
1 Replies
LEARN ABOUT OPENSOLARIS
mkmsgs
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.11 26 Jul 1994 mkmsgs(1)