Sponsored Content
Full Discussion: Nawk Format
Top Forums Shell Programming and Scripting Nawk Format Post 302537499 by ther2000 on Friday 8th of July 2011 11:17:44 AM
Old 07-08-2011
This is the output I am getting with that sed command:

Code:
07/07@04:03:34 ,-,-, 10.7.2.194 ,DIAG 3x3b: Reason: code 0x60
07/07@04:03:34 ,-,-, 10.7.2.194 ,DIAG 3x3b: Reason: code 0x60
07/07@04:04:14 ,-,-, 10.7.2.194 ,DIAG 3x3b: Reason: code 0x60
07/07@04:04:14 ,-,-, 10.7.2.194 ,DIAG 3x3b: Reason: code 0x60
07/07@06:50:04 ,-,-, 10.7.4.84 
07/07@06:50:04 ,-,-, 10.7.4.84 
07/07@11:19:33 ,-,-, 10.7.2.204 ,DIAG 3x3b: Reason: code 0x11, Unmapped address
07/07@11:19:33 ,-,-, 10.7.2.204 ,DIAG 3x3b: Reason: code 0x11, Unmapped address
07/07@11:20:10 ,-,-, 10.7.2.204 ,DIAG 3x3b: Reason: code 0x1, Unmapped address
07/07@11:20:10 ,-,-, 10.7.2.204 ,DIAG 3x3b: Reason: code 0x1, Unmapped address
07/07@15:56:38 ,-,-, 10.7.2.97 
07/07@15:56:38 ,-,-, 10.7.2.97 
07/07@15:57:09 ,-,-, 10.7.2.97 
07/07@15:57:09 ,-,-, 10.7.2.97 
07/07@17:47:57 ,-,-, 10.7.4.51 
07/07@17:47:57 ,-,-, 10.7.4.51

I'd also like to eliminate duplicates if possible.

Last edited by radoulov; 07-08-2011 at 12:28 PM.. Reason: Code tags.
 

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
cosProperty(3erl)					     Erlang Module Definition						 cosProperty(3erl)

NAME
cosProperty - The main module of the cosProperty application DESCRIPTION
To get access to the record definitions for the structures use: -include_lib("cosProperty/include/*.hrl"). This module contains the functions for starting and stopping the application. EXPORTS
install() -> Return Types Return = ok | {'EXIT', Reason} This operation installs the cosProperty application in the IFR. install_db() -> Return Types Return = ok | {'EXIT', Reason} This operation installs data in mnesia necessary for running the cosProperty application. uninstall() -> Return Types Return = ok | {'EXIT', Reason} This operation removes all data in the IFR related to the cosProperty application. uninstall_db() -> Return Types Return = ok | {'EXIT', Reason} This operation removes all data from mnesia related to the cosProperty application. start() -> Return Types Return = ok | {error, Reason} This operation starts the cosProperty application. start_SetDefFactory() -> Return Types Return = Factory | {'EXCEPTION', E} Factory = CosPropertyService::PropertySetDefFactory reference. This operation starts a PropertySetDef Factory. start_SetFactory() -> Return Types Return = Factory | {'EXCEPTION', E} Factory = CosPropertyService::PropertySetDefFactory reference. This operation starts a PropertySet Factory. stop_SetDefFactory(Factory) -> Return Types Factory = CosPropertyService::PropertySetDefFactory reference. Return = ok | {'EXCEPTION', E} This operation stops the supplied PropertySetDef Factory. stop_SetFactory(Factory) -> Return Types Factory = CosPropertyService::PropertySetFactory reference. Return = ok | {'EXCEPTION', E} This operation stops the supplied PropertySet Factory. stop() -> Return Types Return = ok | {error, Reason} This operation stops the cosProperty application. Ericsson AB cosProperty 1.1.13 cosProperty(3erl)
All times are GMT -4. The time now is 11:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy