Sponsored Content
Top Forums Shell Programming and Scripting Assigning Column Values to ARRAY in ksh Post 302752985 by kkabc789 on Monday 7th of January 2013 10:46:06 PM
Old 01-07-2013
Assigning Column Values to ARRAY in ksh

Hi ,

i have file which is having two fields in it (#delimited)
ABC#FILE_01.DAT
DEF#FILE_02.DAT

i want to write first field values to one array example A_01 and second field values to B_02 array

please let me know how to do this ,my final requirement i have send out a mail for each record in file by making first field value as subject and second filed value as content of the mail (the no of records in file will not constant it will changing if a new file arrive )

output example

SUBJECT: ABC

The below file have been processed .(we need to append this line at the begin)

FILE_01.DAT
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Assigning values to an array

The way I've been using arrays currently have been: #!/bin/ksh set -A myArray myArray=value1 myArray=value2 myArray=value3 myArray=value4 Is there a way I can assign values to an array that will automatically place the value into the next element in the array like: myArray=value1... (4 Replies)
Discussion started by: yongho
4 Replies

2. Shell Programming and Scripting

perl: Assigning array values..

I have to add a variable value to an array, something like this: ...... @my_array_name = $value_of_this_variable; This doesnt seem to work, any ideas why? Thanks! (4 Replies)
Discussion started by: looza
4 Replies

3. Shell Programming and Scripting

Assigning the values to an Array

hi every body, i donot know how to assign a array varible with a file see i having file more file property1 Name property2 Address the above two line are tab Space seperated between the property and its value i want to seperate it and assign to... (1 Reply)
Discussion started by: kkraja
1 Replies

4. Shell Programming and Scripting

Assigning values to an array via for/while loop

I need to do something like this: for i in 1 2 3 4 5; do arr=$(awk 'NR="$i" { print $2 }' file_with_5_records) done That is, parse a file and assign values to an array in an ascending order relative to the number of record in the file that is being processed on each loop. Is my... (2 Replies)
Discussion started by: fiori_musicali
2 Replies

5. Shell Programming and Scripting

Assigning values for a dynamic array for an input

Hello, Can somebody please give me a snippet for the below requirement. I want to assign the values separeted by a comma to be assigned to a dynamic array. If I give an input (read statement) like abc1,abc2,abc3,abc4,abc5, all these strings abc* should be assigned to an array like below... (2 Replies)
Discussion started by: suneelj
2 Replies

6. Shell Programming and Scripting

ksh help assigning specific values to variable in script

Hi - Help needed. I have an input file that looks something like this, but with a lot more entries: A Customer1 B 4500 C 8000 A Customer2 B 6422 C 8922 I need to be able to print details for each customer on one line per customer. ie. if I could print these to a file and then cat... (3 Replies)
Discussion started by: frustrated1
3 Replies

7. Emergency UNIX and Linux Support

Assigning zero to element of ksh array.

set -A matched #find referenced files. for i in ${file_names_html} do counter_j=0 for j in ${file_names_minus_index} do match=`cat $i | grep... (1 Reply)
Discussion started by: robin_simple
1 Replies

8. Shell Programming and Scripting

Assigning array values using awk in shell scripting

hi My script as below #!/bin/ksh for i in `seq 1 7` do a=$(awk '{print $i}' /home/rama/expenese.txt) done for i in `seq 1 7` do echo "${a}" done content of expense.txt is as below 5032 210179 3110 132813874 53488966 11459221 5300794 I want output as... (6 Replies)
Discussion started by: Ramakrishna V
6 Replies

9. Shell Programming and Scripting

Perl : Assigning multile hash values to a single array

I know that @food = %fruit; Works. But how do I assign %fruit and %veggies to @food ? (2 Replies)
Discussion started by: popeye
2 Replies

10. Shell Programming and Scripting

Assigning * as value in a ksh array

I want to extract each and single character from a password string and put it in an array. I tried this : set -A password "echo $passwd | awk '{for (i=1; i<=length($1); i++) printf "%s ",substr($1,i,1)}'` It's working as long that the password string doesn't contains any * I tried a few... (5 Replies)
Discussion started by: ce9888
5 Replies
EVENTLOGADM(8)						    System Administration tools 					    EVENTLOGADM(8)

NAME
eventlogadm - push records into the Samba event log store SYNOPSIS
eventlogadm [-d] [-h] -o addsource EVENTLOG SOURCENAME MSGFILE eventlogadm [-d] [-h] -o write EVENTLOG eventlogadm [-d] [-h] -o dump EVENTLOG RECORD_NUMBER DESCRIPTION
This tool is part of the samba(1) suite. eventlogadm is a filter that accepts formatted event log records on standard input and writes them to the Samba event log store. Windows client can then manipulate these record using the usual administration tools. OPTIONS
-d The -d option causes eventlogadm to emit debugging information. -o addsource EVENTLOG SOURCENAME MSGFILE The -o addsource option creates a new event log source. -o write EVENTLOG The -o write reads event log records from standard input and writes them to the Samba event log store named by EVENTLOG. -o dump EVENTLOG RECORD_NUMBER The -o dump reads event log records from a EVENTLOG tdb and dumps them to standard output on screen. -h Print usage information. EVENTLOG RECORD FORMAT
For the write operation, eventlogadm expects to be able to read structured records from standard input. These records are a sequence of lines, with the record key and data separated by a colon character. Records are separated by at least one or more blank line. The event log record field are: o LEN - This field should be 0, since eventlogadm will calculate this value. o RS1 - This must be the value 1699505740. o RCN - This field should be 0. o TMG - The time the eventlog record was generated; format is the number of seconds since 00:00:00 January 1, 1970, UTC. o TMW - The time the eventlog record was written; format is the number of seconds since 00:00:00 January 1, 1970, UTC. o EID - The eventlog ID. o ETP - The event type -- one of "INFO", "ERROR", "WARNING", "AUDIT SUCCESS" or "AUDIT FAILURE". o ECT - The event category; this depends on the message file. It is primarily used as a means of filtering in the eventlog viewer. o RS2 - This field should be 0. o CRN - This field should be 0. o USL - This field should be 0. o SRC - This field contains the source name associated with the event log. If a message file is used with an event log, there will be a registry entry for associating this source name with a message file DLL. o SRN - The name of the machine on which the eventlog was generated. This is typically the host name. o STR - The text associated with the eventlog. There may be more than one string in a record. o DAT - This field should be left unset. EXAMPLES
An example of the record format accepted by eventlogadm: LEN: 0 RS1: 1699505740 RCN: 0 TMG: 1128631322 TMW: 1128631322 EID: 1000 ETP: INFO ECT: 0 RS2: 0 CRN: 0 USL: 0 SRC: cron SRN: dmlinux STR: (root) CMD ( rm -f /var/spool/cron/lastrun/cron.hourly) DAT: Set up an eventlog source, specifying a message file DLL: eventlogadm -o addsource Application MyApplication | \ %SystemRoot%/system32/MyApplication.dll Filter messages from the system log into an event log: tail -f /var/log/messages | \ my_program_to_parse_into_eventlog_records | \ eventlogadm SystemLogEvents VERSION
This man page is correct for version 3.0.25 of the Samba suite. AUTHOR
The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed. Samba 3.5 06/18/2010 EVENTLOGADM(8)
All times are GMT -4. The time now is 04:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy