Sponsored Content
Full Discussion: help with awk command
Top Forums Shell Programming and Scripting help with awk command Post 302688407 by ctrllior on Sunday 19th of August 2012 05:11:21 AM
Old 08-19-2012
help with awk command

Hi,
i'm new here and i need your help with awk.
i got a file with this pattern of lines for example:

15/08/2012 13:04:03:265|FrameworkManager |INF|inbound 15/08/2012 13:04:03:265 80 120 srv_500 38112345999 ContentDiscovery searchByKeywordPage 0 <param[0] == Cell 0 = [subscriber Id = [ field Name = [ USERNAME ]; value = [ test ]; ]; device Id = [ value = [ Mozilla/5.0 (Linux; U; Android 2.3.6; sr-rs; U8655-1 Build/HuaweiU8655) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 ]; identifier Type = [ 3 ]; ]; locale = [ en ]; max Results = [ 1000 ]; start Index = [ 0 ]; entity Types = [ Cell 0 = [10] ; ]; media Types = [ local Item = [ ]; ]; portal = [ Telenor Serbia Mobile Portal ]; screen = [ Mobile ]; sorting Parameters = [ Cell 0 = [entity Type = [ 11 ]; sorting Entity Parameters = [ Cell 0 = [order By = [ Number of downloads ]; direction = [ desc ]; ] ; ]; ] ; ]; reserved Attr = [ local Item = [ ]; ]; ALLOWED_ ENTITY_ TYPES_ TO_ = [ Cell 0 = [4] ;Cell 1 = [10] ;Cell 2 = [4] ;Cell 3 = [3] ;Cell 4 = [9] ; ]; promoted Entity Types = [ local Item = [ ]; ]; ] ;Cell 1 = [zdrava ishrana] ;Cell 2 = [value = [ Apps Home ]; entity Type = [ 2 ]; ] ; /> current Node = [ category = [ ID:cat_513 NAME: en - Apps Home CONTENT_PROVIDER:null ]; packages Ids = [ Cell 0 = [value = [ Telenor Serbia Wap Package ]; entity Type = [ 0 ]; ] ; ]; has Special Offer = [ false ]; absolute URLPrefix = [ http://market.dobrestvari.rs:80/DS ]; ]; menu = [ ]; menu Size = [ 0 ]; favorite = [ false ]; sorting Override By Portal Enabled = [ true ];

i marked the words i need to get out from this block as bold... please help me.. :]
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

assign a command line argument and a unix command to awk variables

Hi , I have a piece of code ...wherein I need to assign the following ... 1) A command line argument to a variable e.g origCount=ARGV 2) A unix command to a variable e.g result=`wc -l testFile.txt` in my awk shell script When I do this : print "origCount" origCount --> I get the... (0 Replies)
Discussion started by: sweta_doshi
0 Replies

2. Shell Programming and Scripting

awk/sed Command : Parse parameter file / send the lines to the ksh export command

Sorry for the duplicate thread this one is similar to the one in https://www.unix.com/shell-programming-scripting/88132-awk-sed-script-read-values-parameter-files.html#post302255121 Since there were no responses on the parent thread since it got resolved partially i thought to open the new... (4 Replies)
Discussion started by: rajan_san
4 Replies

3. UNIX for Dummies Questions & Answers

Basic awk question...getting awk to act on $1 of the command itself

I have a script problem that I am not able to solve due my very limited understanding of unix/awk. This is the contents of test.sh awk '{print $1}' From the prompt if I enter: ./test.sh Hello World I would expect to see "Hello" but all I get is a blank line. Only then if I enter "Hello... (2 Replies)
Discussion started by: JasonHamm
2 Replies

4. Shell Programming and Scripting

awk command for simple join command but based on 2 columns

input1 a_a a/a 10 100 a1 a_a 20 200 b1 b_b 30 300 input2 a_a a/a xxx yyy a1 a1 lll ppp b1 b_b kkk ooo output a_a a/a 10 100 xxx yyy (2 Replies)
Discussion started by: ruby_sgp
2 Replies

5. Shell Programming and Scripting

awk command in script gives error while same awk command at prompt runs fine: Why?

Hello all, Here is what my bash script does: sums number columns, saves the tot in new column, outputs if tot >= threshold val: > cat getnon0file.sh #!/bin/bash this="getnon0file.sh" USAGE=$this" InFile="xyz.38" Min="0.05" # awk '{sum=0; for(n=2; n<=NF; n++){sum+=$n};... (4 Replies)
Discussion started by: catalys
4 Replies

6. Shell Programming and Scripting

awk command to compare a file with set of files in a directory using 'awk'

Hi, I have a situation to compare one file, say file1.txt with a set of files in directory.The directory contains more than 100 files. To be more precise, the requirement is to compare the first field of file1.txt with the first field in all the files in the directory.The files in the... (10 Replies)
Discussion started by: anandek
10 Replies

7. Shell Programming and Scripting

Multiple command execution inside awk command during xml parsing

below is the output xml string from some other command and i will be parsing it using awk cat /tmp/alerts.xml <Alert id="10102" name="APP-DS-ds_ha-140018-componentFailure-S" alertDefinitionId="13982" resourceId="11427" ctime="1359453507621" fixed="false" reason="If Event/Log Level(ANY) and... (2 Replies)
Discussion started by: vivek d r
2 Replies

8. Shell Programming and Scripting

Pass awk field to a command line executed within awk

Hi, I am trying to pass awk field to a command line executed within awk (need to convert a timestamp into formatted date). All my attempts failed this far. Here's an example. It works fine with timestamp hard-codded into the command echo "1381653229 something" |awk 'BEGIN{cmd="date -d... (4 Replies)
Discussion started by: tuxer
4 Replies
pattern(3MENU)															    pattern(3MENU)

NAME
pattern - get and set a menu's pattern buffer SYNOPSIS
#include <menu.h> int set_menu_pattern(MENU *menu, const char *pattern); char *menu_pattern(const MENU *menu); DESCRIPTION
Every menu has an associated pattern match buffer. As input events that are printable characters come in, they are appended to this match buffer and tested for a match, as described in driver(3MENU). The function set_menu_pattern sets the pattern buffer for the given menu and tries to find the first matching item. If it succeeds, that item becomes current; if not, the current item does not change. The function menu_pattern returns the pattern buffer of the given menu. RETURN VALUE
The function menu_pattern returns a pointer, which is NULL if the menu parameter is NULL. Otherwise, it is a pointer to a string which is empty if no pattern has been set. It does not set errno. The function set_menu_pattern may return the following error codes: E_OK The routine succeeded. E_BAD_ARGUMENT Routine detected an incorrect or out-of-range argument. E_BAD_STATE Routine was called from an initialization or termination function. E_NOT_CONNECTED No items are connected to menu. E_NO_MATCH Character failed to match. E_SYSTEM_ERROR System error occurred (see errno). SEE ALSO
ncurses(3NCURSES), menu(3MENU). NOTES
The header file <menu.h> automatically includes the header file <curses.h>. PORTABILITY
These routines emulate the System V menu library. They were not supported on Version 7 or BSD versions. AUTHORS
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. pattern(3MENU)
All times are GMT -4. The time now is 09:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy