Sponsored Content
Full Discussion: Nawk Format
Top Forums Shell Programming and Scripting Nawk Format Post 302537510 by ctsgnb on Friday 8th of July 2011 11:50:35 AM
Old 07-08-2011
I updated my previous post.

Code:
# cat tst
-07/07@04:03:34 - 10.7.23.144 : DIAG 3x3b: Reason: code 0x60, Sent by kernel-
-07/07@04:04:14 - 10.37.42.194 : DIAG 3x3b: Reason: code 0x60, Sent by kernel-
-07/07@06:50:04 - 10.7.14.854 : DIAG 0x72: Reason: FATAL MEMORY ERROR - guard band corrupt (addr:0x70e6190 size:32 owner:75(TblMgr Main)) at _mem_DeletePointer line 1737-
-07/07@08:35:28 - 10.7.62.820 : DIAG 0x72: Reason: OCP initiated reset...Rebooting from Delay Dial Option-
-07/07@10:33:14 - 10.7.23.167 : DIAG 0x72: Reason: PASSTHRU RESET MESSAGE-
-07/07@10:34:28 - 10.7.42.621 : DIAG 0x72: Reason: OCP initiated reset...Rebooting from Delay Dial Option-
-07/07@11:19:33 - 10.5.26.704 : DIAG 3x3b: Reason: code 0x11, Unmapped address, fault address: 0x00000925-
-07/07@11:19:33 - 10.7.26.704 : DIAG 3x3b: Reason: code 0x11, Unmapped address, fault address: 0x00000925-
-07/07@11:19:45 - 10.7.24.277 : DIAG 0x72: Reason: OCP initiated reset...Rebooting from Delay Dial Option-
-07/07@15:43:47 - 10.7.25.474 : DIAG 0x72: Reason: PASSTHRU RESET MESSAGE-
-07/07@15:56:38 - 10.7.65.77 : DIAG 0x72: Reason: Error! line 548 of dacct_ExitLoadClImage() in dacctrail/dacct.c-
-07/07@17:13:40 - 10.7.23.342 : DIAG 0x72: Reason: OCP initiated reset...IMAGE upgrade complete!-
-07/07@17:47:57 - 10.5.44.351 : DIAG 0x72: Reason: ERROR: dk_Reset called.-
# sed '/OCP/d;/PASSTHRU RESET/d;/Reason/!d;s/ \- /,-,-,/;s/ : /,/;s/\([0-9\.]*\),DIAG[^-]*/&,$DATE,\1/;s/\.,/,/;s/-$//' tst
-07/07@04:03:34,-,-,10.7.23.144,DIAG 3x3b: Reason: code 0x60, Sent by kernel,$DATE,10.7.23.144
-07/07@04:04:14,-,-,10.37.42.194,DIAG 3x3b: Reason: code 0x60, Sent by kernel,$DATE,10.37.42.194
-07/07@06:50:04,-,-,10.7.14.854,DIAG 0x72: Reason: FATAL MEMORY ERROR ,$DATE,10.7.14.854- guard band corrupt (addr:0x70e6190 size:32 owner:75(TblMgr Main)) at _mem_DeletePointer line 1737
-07/07@11:19:33,-,-,10.5.26.704,DIAG 3x3b: Reason: code 0x11, Unmapped address, fault address: 0x00000925,$DATE,10.5.26.704
-07/07@11:19:33,-,-,10.7.26.704,DIAG 3x3b: Reason: code 0x11, Unmapped address, fault address: 0x00000925,$DATE,10.7.26.704
-07/07@15:56:38,-,-,10.7.65.77,DIAG 0x72: Reason: Error! line 548 of dacct_ExitLoadClImage() in dacctrail/dacct.c,$DATE,10.7.65.77
-07/07@17:47:57,-,-,10.5.44.351,DIAG 0x72: Reason: ERROR: dk_Reset called,$DATE,10.5.44.351
# sed '/OCP/d;/PASSTHRU RESET/d;/Reason/!d;s;^\([^ ]*\) - \([^ ]*\) : \(.*\)-$;\1,-,-,\2,\3,$DATE/\2;;s/\.,/,/' tst
-07/07@04:03:34,-,-,10.7.23.144,DIAG 3x3b: Reason: code 0x60, Sent by kernel,$DATE/10.7.23.144
-07/07@04:04:14,-,-,10.37.42.194,DIAG 3x3b: Reason: code 0x60, Sent by kernel,$DATE/10.37.42.194
-07/07@06:50:04,-,-,10.7.14.854,DIAG 0x72: Reason: FATAL MEMORY ERROR - guard band corrupt (addr:0x70e6190 size:32 owner:75(TblMgr Main)) at _mem_DeletePointer line 1737,$DATE/10.7.14.854
-07/07@11:19:33,-,-,10.5.26.704,DIAG 3x3b: Reason: code 0x11, Unmapped address, fault address: 0x00000925,$DATE/10.5.26.704
-07/07@11:19:33,-,-,10.7.26.704,DIAG 3x3b: Reason: code 0x11, Unmapped address, fault address: 0x00000925,$DATE/10.7.26.704
-07/07@15:56:38,-,-,10.7.65.77,DIAG 0x72: Reason: Error! line 548 of dacct_ExitLoadClImage() in dacctrail/dacct.c,$DATE/10.7.65.77
-07/07@17:47:57,-,-,10.5.44.351,DIAG 0x72: Reason: ERROR: dk_Reset called,$DATE/10.5.44.351


Last edited by ctsgnb; 07-08-2011 at 01:28 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to access values of awk/nawk variables outside the awk/nawk block?

i'm new to shell scripting and have a problem please help me in the script i have a nawk block which has a variable count nawk{ . . . count=count+1 print count } now i want to access the value of the count variable outside the awk block,like.. s=`expr count / m` (m is... (5 Replies)
Discussion started by: saniya
5 Replies

2. Shell Programming and Scripting

awk/nawk question to format a file

Hi, I am new to awk/nawk, needs help. I want to merge the rows having emplid attribute same into a single row in the following file. In actual this kind of file will have around 50k rows. Here is my input file id|emplid|firstname|dep|lastname 1|001234|test|1001|1 2|002345|test|1032|2... (7 Replies)
Discussion started by: kumar04
7 Replies

3. Shell Programming and Scripting

Format - Inventory Row data into Column - Awk - Nawk

Hi All, I have the following file that has computer data for various pcs in my network... Snap of the file is as follows ******************************************************************************* Serial 123456 Computer IP Address lo0:... (1 Reply)
Discussion started by: aavam
1 Replies

4. Shell Programming and Scripting

how to parse the file in xml format using awk/nawk

Hi All, I have an xml file with the below format. <a>111</a><b>222</b><c>333<c><d><e>123</e><f>234</f><d><e>456</e><f>789</f> output needed is 111,222,333,123,234 111,222,333,456,789 nawk 'BEGIN{FS="<|>"} {print a,b,c,e,f a="" ... (7 Replies)
Discussion started by: natalie23
7 Replies

5. Shell Programming and Scripting

Nesting - two nawk into one nawk

hi people; this is my two awk code: nawk '/cell+-/{r=(NF==8) ? $4FS$5FS$6 : NF==7 ? $4FS$5 : $4 ;c=split(r,rr);for (i=1;i<=c;i++){if(rr != "111111"){printf($3" %d ""\n",(i+3))}}printf("")}' /home/gc_sw/str.txt > /home/gc_sw/predwn.txt nawk -F'*' '{gsub(/ *$/,"")}$0=$1$($NF-2)'... (2 Replies)
Discussion started by: gc_sw
2 Replies

6. Shell Programming and Scripting

NAWK: changing string-format with split

Hi all, I try to make a awk-script, which counts lines, summarized by pdf and xml. So far it works, but for sorting reasons, I'd like to change the format from the field $1 from dd-mm-yyyy to yyyy-mm-dd. This works find, but: split() and sprintf() prints its output (for no reason, the results... (2 Replies)
Discussion started by: regisl67
2 Replies

7. Shell Programming and Scripting

Using awk or nawk to convert epoch time to date format

Looking for some help and usually when I do a search this site comes up. Hopefully someone can give me a little direction as to how to use one of these two commands to achieve what I'm trying to do. What am I trying to do? I need to take the time value in epoch format returned from the... (5 Replies)
Discussion started by: minigts
5 Replies

8. Shell Programming and Scripting

Need script for transferring bulk files from one format to text format

"Help Me" Need script for transferring bulk files from one format to text format in a unix server. Please suggest (2 Replies)
Discussion started by: Kranthi Kumar
2 Replies

9. Shell Programming and Scripting

Nawk Problem - nawk out of space in tostring on

Hi.. i am running nawk scripts on solaris system to get records of file1 not in file2 and find duplicate records in a while with the following scripts -compare nawk 'NR==FNR{a++;next;} !a {print"line"FNR $0}' file1 file2duplicate - nawk '{a++}END{for(i in a){if(a-1)print i,a}}' file1in the middle... (12 Replies)
Discussion started by: Abhiraj Singh
12 Replies

10. UNIX for Beginners Questions & Answers

Date format conversion how to change this from using nawk to awk

Hi, I have a file where I need to change the date format on the nth field from DD-MM-YYYY to YYYY-MM-DD so I can accurately sort the record by dates From regex - Use sed or awk to fix date format - Stack Overflow, I found an example using nawk. Test run as below: $: cat xyz.txt A ... (2 Replies)
Discussion started by: newbie_01
2 Replies
asn1rt(3erl)						     Erlang Module Definition						      asn1rt(3erl)

NAME
asn1rt - ASN.1 runtime support functions DESCRIPTION
This module is the interface module for the ASN.1 runtime support functions. To encode and decode ASN.1 types in runtime the functions in this module should be used. EXPORTS
start() -> ok |{error,Reason} Types Reason = term() Starts the asn1 server that loads the drivers. The server schedules a driver that is not blocked by another caller. The driver is used by the asn1 application if specs are com- piled with options [per_bin, optimize] or [ber_bin, optimize, driver] . The server will be started automatically at encode/decode if it isn't done explicitly. If encode/decode with driver is used in test or industrial code it is a performance gain to start it explicitly to avoid the one time load in run-time. stop() -> ok |{error,Reason} Types Reason = term() Stops the asn1 server and unloads the drivers. decode(Module,Type,Bytes) -> {ok,Value}|{error,Reason} Types Module = Type = atom() Value = Reason = term() Bytes = binary | [Int] when integer(Int), Int >= 0, Int =< 255 | binary Decodes Type from Module from the list of bytes or binary Bytes . If the module is compiled with ber_bin or per_bin option Bytes must be a binary. Returns {ok,Value} if successful. encode(Module,Type,Value)-> {ok,BinOrList} | {error,Reason} Types Module = Type = atom() Value = term() BinOrList = Bytes | binary() Bytes = [Int|binary|Bytes] when integer(Int), Int >= 0, Int =< 255 Reason = term() Encodes Value of Type defined in the ASN.1 module Module . Returns a possibly nested list of bytes and or binaries if successful. If Module was compiled with the options per_bin and optimize the result is a binary. To get as fast execution as possible the encode function only performs rudimentary tests that the input Value is a correct instance of Type . The length of strings is for example not always checked. info(Module) -> {ok,Info} | {error,Reason} Types Module = atom() Info = list() Reason = term() info/1 returns the version of the asn1 compiler that was used to compile the module. It also returns the compiler options that was used. load_driver() -> ok | {error,Reason} Types Reason = term() This function loads the linked-in driver before the first call to encode. If this function is not called the driver will be loaded automatically at the first call to encode. If one doesn't want the performance cost of a driver load when the application is run- ning, this function makes it possible to load the driver in an initialization. The driver is only used when encoding/decoding ASN.1 files that were compiled with the options per_bin and optimize . unload_driver() -> ok | {error,Reason} Types Reason = term() This function unloads the linked-in driver. When the driver has been loaded it remains in the environment until it is unloaded. Nor- mally the driver should remain loaded, it is crucial for the performance of ASN.1 encoding. The driver is only used when ASN.1 modules have been compiled with the flags per_bin and optimize . utf8_binary_to_list(UTF8Binary) -> {ok,UnicodeList} | {error,Reason} Types UTF8Binary = binary() UnicodeList = [integer()] Reason = term() utf8_binary_to_list/1 Transforms a UTF8 encoded binary to a list of integers, where each integer represents one character as its unicode value. The function fails if the binary is not a properly encoded UTF8 string. utf8_list_to_binary(UnicodeList) -> {ok,UTF8Binary} | {error,Reason} Types UnicodeList = [integer()] UTF8Binary = binary() Reason = term() utf8_list_to_binary/1 Transforms a list of integers, where each integer represents one character as its unicode value, to a UTF8 encoded binary. validate(Module,Type,Value) -> ok | {error,Reason} Types Module = Type = atom() Value = term() Validates that Value conforms to Type from Module . Not implemented in this version of the ASN.1 application. Ericsson AB asn1 1.6.16 asn1rt(3erl)
All times are GMT -4. The time now is 03:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy