Thank You MadeInGermany; The first solution did work; however the second solution did produce the same output as my post (not able to recognize ; as RS) Can you please explain how
different is to that of a simple ones;
I am not able to understand the difference as I am learning awk
Edit:
Does [] ignore the conventional "\n" as RS unless specified other than this in all cases and does awk -F "@" considers the RS as "\n" when the specified RS is not specified or found in the entire line..
Last edited by chill3chee; 04-18-2016 at 02:08 PM..
I am an Awk newbie and cannot wrap my brain around my problem:
Given multi-line records of varying lengths separated by a blank line I need to skip the first two lines
of every record and extract every-other line in each record unless the first line of the record has the word "(CONT)" in the... (10 Replies)
I have a set of files of multi-line records with the records separated by a blank line. I needed to add a record number to the front of each line followed by a colon and did the following:
awk 'BEGIN {FS = "\n"; RS = ""}{for (i=1; i<=NF; i++)print NR,":",$i}' ~/Desktop/data98-1-25.txt >... (3 Replies)
Hi all,
I want to search for a data type in a line.For this in a loop i am checking for $DATA_TYPE in a line using grep.But grep is not able to find when i give this.
Can any one tell me how to check string in $DATA_TYPE variable in line usign grep (or) any other way to do the above task.
... (4 Replies)
Hi.
I am reasonably new to awk, but have done quite a lot of unix scripting in the past. I have resolved the issues below with unix scripting but it runs like a dog. Moved to awk for speed and functionality but running up a big learning curve in a hurry, so hope there is some help here.
I... (6 Replies)
Hey there,
I have a table of contents file of the form
1 Title1
1.1 Subtitle1
1.1.1 Subsubtitle1
1.1.2 Subsubtitle2
...
and want to count the number of dots in the first field to find out the level of the section.
I use the gsub function for the job, which works if I pass the pattern... (2 Replies)
I am trying to write a script that will help me put a file into excel with little manipulation. Below is a sample of the file im using.
Group1:*:gid1:user,user
Group2:*:gid2:user,user
Group3:*:gid3:user,user,user,user,user,user,user
Group4:*:gid4:user,user
I marked in red the part that is... (1 Reply)
I want something that would show up basically like:
Menu
-----
1) Option 1
2) Option 2
3) Option 3
Pick one:
I tried menu = " Menu \r\n ----- \r\n 1)Option 1 \r\n..............etc etc etc"
but that didnt work (just got the whole menu one one line, with the... (2 Replies)
I have a file with data records separated by multiple equals signs, as below.
==========
RECORD 1
==========
RECORD 2
DATA LINE
==========
RECORD 3
==========
RECORD 4
DATA LINE
==========
RECORD 5
DATA LINE
==========
I need to filter out all data from this file where the... (2 Replies)
Greetings experts,
Have 2 input files, of which 1 file has 1 record per line; in 2nd file, multiple lines constitute 1 record; Hence declared the RS=";"
Now in the first file which ends with ";" at each line of the line; But \nis also being considered as part of the data due to which
I am... (1 Reply)
The bash bash below extracts the oldest folder from a directory and stores it in filename
That result will match a line in bold in input. In the matching line there is an_xxx digit in italics that
(once the leading zero is removed) will match a line in link. That is the lint to print in output.... (2 Replies)
Discussion started by: cmccabe
2 Replies
LEARN ABOUT REDHAT
compile_et
COMPILE_ET(1) General Commands Manual COMPILE_ET(1)NAME
compile_et - error table compiler
SYNOPSIS
compile_et file
DESCRIPTION
Compile_et converts a table listing error-code names and associated messages into a C source file suitable for use with the com_err(3)
library.
The source file name must end with a suffix of ``.et''; the file consists of a declaration supplying the name (up to four characters long)
of the error-code table:
error_table name
followed by up to 256 entries of the form:
error_code name, " string "
and a final
end
to indicate the end of the table.
The name of the table is used to construct the name of a subroutine initialize_XXXX_error_table which must be called in order for the
com_err library to recognize the error table.
The various error codes defined are assigned sequentially increasing numbers (starting with a large number computed as a hash function of
the name of the table); thus for compatibility it is suggested that new codes be added only to the end of an existing table, and that no
codes be removed from tables.
The names defined in the table are placed into a C header file with preprocessor directives defining them as integer constants of up to 32
bits in magnitude.
A C source file is also generated which should be compiled and linked with the object files which reference these error codes; it contains
the text of the messages and the initialization subroutine. Both C files have names derived from that of the original source file, with
the ``.et'' suffix replaced by ``.c'' and ``.h''.
A ``#'' in the source file is treated as a comment character, and all remaining text to the end of the source line will be ignored.
BUGS
Since the original compile_et uses a very simple parser based on yacc(1), and this current version of compile_et uses an awk/sed combina-
tion of scripts, its error recovery leaves much to be desired.
SEE ALSO
com_err (3).
Ken Raeburn, "A Common Error Description Library for UNIX".
SIPB 30 Mar 1998 COMPILE_ET(1)