Sponsored Content
Full Discussion: Many to many -- mapping
Top Forums Shell Programming and Scripting Many to many -- mapping Post 303022293 by Peasant on Wednesday 29th of August 2018 10:17:17 AM
Old 08-29-2018
Is this correct explanation of that specific line ?

Create array named 'a' indexed with first field with conditional value of : if first field exist in array a , set value to that array member, comma and second field, otherwise set the value to second field.
This will effectivley, append second field if array is defined with index of currently processing line, otherwise, create array member with value of second field.
Code:
...
    a[$1]=($1 in a)?a[$1] "," $2:$2
...


Thanks and regards
Peasant.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

LUN mapping

Hi, We recently purchased a 3 tb RAID. In the setup, it created 2 slices, one 2 tb and one 1 tb slice. Right now only the 2 tb slice is visible when booting up. I was told that the second slice needs to be mapped to a lun and a port like the first slice is. Does anyone know how I would go... (1 Reply)
Discussion started by: user23
1 Replies

2. UNIX for Advanced & Expert Users

kernel mapping...

> how the sendmsg and recvmsg calls will know which kernel module to use (SCTP, RTP etc.) internally(kernel mapping: how kernel handle socket call) (1 Reply)
Discussion started by: prangin
1 Replies

3. UNIX for Dummies Questions & Answers

Keyboard Mapping HP-UX

This is truly embarrassing but I have to know the answer anyway :p Can anyone share, how to assign keyboard mapping in hp-ux system? Every time I issue command which contain character "@", it'll go the next line. What I need is how to assign the character "@" to @ as it is supposed to be. ... (2 Replies)
Discussion started by: Olli.Lang
2 Replies

4. Shell Programming and Scripting

searching and mapping

Hi, I just started looking into various aspect of unix shell scripting. I am completely new to the world of UNIX. Could any one help me in solving the following requirement. I have a parameter file with some data e.g. sample.param ------------- Andrew=201 Bob=219 Shelly=239... (4 Replies)
Discussion started by: mamatabbsr
4 Replies

5. Shell Programming and Scripting

Pattern mapping

Dear Friends, Please help me on this I have file A.txt containing text lines as below grectec; 30 ,50, 60, base_123 ; top09 grectec; 30 ,55, 60, base_123 ; top09 grectec; 10 ,53, 60, base_123 ; top09 grectec; 50 ,57, 60, base_123 ; top09 ... ... another file B.txt containing test... (4 Replies)
Discussion started by: Danish Shakil
4 Replies

6. Shell Programming and Scripting

Bit Mapping

Hi All, I am working on the Scenario where i need compare the integer value with other using bit mapping. input file, 1,4,5,4 1,2,4,6 2,3,4,4 like i have many fields. Script : i need to filter hte field one value "1" and field 3 value "4" and Filed 4 i need to do the Bitwise... (5 Replies)
Discussion started by: readycpbala
5 Replies

7. Red Hat

Key Mapping

Hi All i am a tad stuck i am trying to map alt gr key so that it acts as a Alt key i tried xmodmap but it went very wrong and it disabled both alt gr and alt key thanks Adam (0 Replies)
Discussion started by: ab52
0 Replies

8. UNIX for Dummies Questions & Answers

Re-Mapping Printers.

Hi we have a situation where some printers are on a server that sometimes has to be rebooted. If this happens the Unix boxes we have that are referencing the printers in the vfstab file fail to work even when the print server is brought back up. Does anyone know if it would be possible to put... (0 Replies)
Discussion started by: Hadleyshope
0 Replies

9. Shell Programming and Scripting

Need Help Mapping Arrays

I have the following arrays with different lengths that I want to map them with the same key. # Week numbers, 8 columns @headers = ("2011-34", "2011-35", "2011-36", "2011-37", "2011-38", "2011-39", "2011-40", "2011-41"); %data = ("2011-34", BCE, "2011-35", YZA, "2011-36",... (5 Replies)
Discussion started by: tqlam
5 Replies

10. Shell Programming and Scripting

Creating unique mapping from multiple mapping

Hello, I do not know if this is the right title to use. I have a large dictionary database which has the following structure: where a b c d e are in English and p q r s t are in a target language., the two separated by the delimiter =. What I am looking for is a perl script which will take... (5 Replies)
Discussion started by: gimley
5 Replies
field(3FORM)															      field(3FORM)

NAME
field - make and break connections between fields and forms SYNOPSIS
#include <form.h> int set_form_fields(FORM *form, FIELD **fields); FIELD **form_fields(const FORM *form); int field_count(const FORM *form); int move_field(FIELD *field, int frow, int fcol); DESCRIPTION
The function set_form_fields changes the field pointer array of the given form. The array must be terminated by a NULL. The function form_fields returns the field array of the given form. The function field_count returns the count of fields in form. The function move_field moves the given field (which must be disconnected) to a specified location on the screen. RETURN VALUES
The function form_fields returns a pointer (which may be NULL). It does not set errno. The function field_count returns ERR if the form parameter is NULL. The functions set_form_fields and move_field return one of the following codes on error: E_OK The routine succeeded. E_BAD_ARGUMENT Routine detected an incorrect or out-of-range argument. E_CONNECTED The field is already connected to a form. E_POSTED The form is already posted. E_SYSTEM_ERROR System error occurred (see errno). SEE ALSO
ncurses(3NCURSES), form(3FORM). NOTES
The header file <form.h> automatically includes the header file <curses.h>. PORTABILITY
These routines emulate the System V forms library. They were not supported on Version 7 or BSD versions. The SVr4 forms library documentation specifies the field_count error value as -1 (which is the value of ERR). AUTHORS
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. field(3FORM)
All times are GMT -4. The time now is 09:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy