06-11-2009
perl help for comma seperated output
Hi,
how can i make a comma seperated output summary.
i attached the sample log file.
I have to capture these data in the log file.
Arcotid
Time Stamp, Username, Success, Failure, Error Code, Error Message
In the log snippet the userID can be found in-
Code
Arcot Native Server: recvd AA_BIN_MSG_VER_CHG
Cert Subject String....:[CN=01095848;O=MLS; UserID=012345; CardName=ARCARD]
Success and failure are like this-
Code
ArcotID Auth SUCCESS (serial Number [e93b])
Auth fail due to signature verification.Serial Number [11872](This is error message also)
Code
error code is -
Authentication mechanism returned [3], here 3 is error code and for success error code is always 0.
Formatting and printing in csv format is the part i am unaware,so i require your help in this.I need to do this for all authentication methods so if i get help in one i will be able to do it for rest.
Thanks
NT
Last edited by namishtiwari; 06-15-2009 at 06:58 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Guys,
I am trying to reading in comma seperated values in awk. I can set the delimiter to be a comma, but the tricky part is that commas that appear within quotes are not to be considered as delimiters. Could someone please help.
Regards,
Laud (1 Reply)
Discussion started by: Laud12345
1 Replies
2. Shell Programming and Scripting
Hi,
I have a comma seperated list of values:
export list="red,blue,white,yellow"
Given a value in a variable "look", i want to check whether the value is available in the above list. But the result should be based on exact string match and not part of the string.
I am using following... (9 Replies)
Discussion started by: brap45
9 Replies
3. Shell Programming and Scripting
I have a list of servers in a file called serverlist like this
server1
server2
server3
i need to have them (with no trailing comma, the program does not like that)
server1,server2,server3
so far i have been using
HOSTS=/tmp/serverlist
HOSTS=${HOSTS:-$(grep -Ev "^#|^$"... (2 Replies)
Discussion started by: insania
2 Replies
4. UNIX for Dummies Questions & Answers
My query is now a bit simplified.
file1.txt
names; ID; value1 ; values N;
ABC; 1 ; a18 ; ...
CDF; 2 ; b16 ; ..
ABC; 1 ; c13 ; ......
EFG; 3 ;d12 ; ...
file2.txt
ID(Unique);smVals; smVal1; smVal N;
1; ...; ...; ...;
2; ..; ..; ..;
3; ..; ..; ..; ... (1 Reply)
Discussion started by: szchmaltz
1 Replies
5. Shell Programming and Scripting
Hi,
I want to remove empty/blank lines from comma seperated and space seperated files
Thanks all for help (11 Replies)
Discussion started by: pinnacle
11 Replies
6. Shell Programming and Scripting
I have a file like below. How can I add a new value after moss separated by a comma. This adding script should work in such a way that each time i pass a value it should be added one after the other separated by commas.
hru:122:
hello:123:john,philip,mary,kp,moss
hi:124:
bye:125:
Can... (7 Replies)
Discussion started by: Tuxidow
7 Replies
7. Shell Programming and Scripting
Hi
How to takes coma seperated arguments and and parsing each argument to varaiable that has used further in the script. (1 Reply)
Discussion started by: Reddy482
1 Replies
8. Shell Programming and Scripting
Hi,
I have data like this.
1,2,3,4
Output required:
1
2
3
4
I am trying to use tr function but getting error.
Help is appreciated. (6 Replies)
Discussion started by: pinnacle
6 Replies
9. Shell Programming and Scripting
I have a file with the below content
a = test1
b = test2
a = test3
b= test4
c = test6
b = test5
d = test7
d = test9
Need the output to be as follows
a = test1,test3
b = test2, test5
c = test6
d = test7, test9 (4 Replies)
Discussion started by: iron_michael86
4 Replies
10. Shell Programming and Scripting
Hi,
I have a data file separated by comma, data enclosed by ""
head file.txt
"HD","Sep 13 2016 1:05AM","0001"
"DT","273093045","192534"
"DT","273097637","192534"
..
I want to get the 3rd column value (0001) to be assigned to my variable
I tried
FILE_VER=`cat file.txt | awk... (2 Replies)
Discussion started by: Prasannag87
2 Replies
LEARN ABOUT REDHAT
tclx_keyedlistget
Tcl_GetKeyedListKeys(3tclx) Tcl_GetKeyedListKeys(3tclx)
NAME
TclX_NewKeyedListObj, TclX_KeyedListGet, TclX_KeyedListSet, TclX_KeyedListDelete, TclX_KeyedListGetKeys - Keyed list management routines.
SYNOPSIS
#include <tclExtend.h>
Tcl_Obj *
TclX_NewKeyedListObj (void);
int
TclX_KeyedListGet (Tcl_Interp *interp,
Tcl_Obj *keylPtr,
char *key,
Tcl_Obj **valuePtrPtr);
int
TclX_KeyedListSet (Tcl_Interp *interp,
Tcl_Obj *keylPtr,
char *key,
Tcl_Obj *valuePtr);
int
TclX_KeyedListDelete (Tcl_Interp *interp,
Tcl_Obj *keylPtr,
char *key);
int
TclX_KeyedListGetKeys (Tcl_Interp *interp,
Tcl_Obj *keylPtr,
char *key,
Tcl_Obj **listObjPtrPtr);
DESCRIPTION
These routines perform operations on keyed lists. See the Extended Tcl man page for a description of keyed lists.
TclX_NewKeyedListObj
Create and initialize a new keyed list object.
Returns:
A pointer to the object.
TclX_KeyedListGet
Retrieve a key value from a keyed list.
Parameters:
o interp - Error message will be return in result if there is an error.
o keylPtr - Keyed list object to get key from.
o key - The name of the key to extract. Will recusively process sub-keys seperated by `.'.
o valueObjPtrPtr - If the key is found, a pointer to the key object
is returned here. NULL is returned if the key is not present.
Returns:
o TCL_OK - If the key value was returned.
o TCL_BREAK - If the key was not found.
o TCL_ERROR - If an error occured.
TclX_KeyedListSet
Set a key value in keyed list object.
Parameters:
o interp - Error message will be return in result object.
o keylPtr - Keyed list object to update.
o key - The name of the key to extract. Will recusively process sub-key seperated by `.'.
o valueObjPtr - The value to set for the key.
Returns:
TCL_OK or TCL_ERROR.
TclX_KeyedListDelete
Delete a key value from keyed list.
Parameters:
o interp - Error message will be return in result if there is an error.
o keylPtr - Keyed list object to update.
o key - The name of the key to extract. Will recusively process sub-key seperated by `.'.
Returns:
o TCL_OK - If the key was deleted.
o TCL_BREAK - If the key was not found.
o TCL_ERROR - If an error occured.
TclX_KeyedListGetKeys
Retrieve a list of keyed list keys.
Parameters:
o interp - Error message will be return in result if there is an error.
o keylPtr - Keyed list object to get key from.
o key - The name of the key to get the sub keys for. NULL or empty to retrieve all top level keys.
o listObjPtrPtr - List object is returned here with key as values.
Returns:
o TCL_OK - If the zero or more key where returned.
o TCL_BREAK - If the key was not found.
o TCL_ERROR - If an error occured.
Tcl Tcl_GetKeyedListKeys(3tclx)