Sponsored Content
Top Forums Shell Programming and Scripting Concatenating column values with unique id into single row Post 302345966 by danmero on Thursday 20th of August 2009 05:54:03 PM
Old 08-20-2009
Code:
awk -F "          " 'NR>2{t[$1]?t[$1]=t[$1]","$2:t[$1]=$2;next}1 END{for (i in t){print i FS t[i]}}' file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting Column values to comma delimted single Row

I have a requirement in which i have to read a file which has multiple columns seperated by a pipe "|" from this i have to read each column values seperately and create a comma seperated row for the column and write to another file. eg: Input file: ColA ColB 1 2 2 x 3 y... (5 Replies)
Discussion started by: nvuradi
5 Replies

2. Shell Programming and Scripting

print unique values of a column and sum up the corresponding values in next column

Hi All, I have a file which is having 3 columns as (string string integer) a b 1 x y 2 p k 5 y y 4 ..... ..... Question: I want get the unique value of column 2 in a sorted way(on column 2) and the sum of the 3rd column of the corresponding rows. e.g the above file should return the... (6 Replies)
Discussion started by: amigarus
6 Replies

3. Shell Programming and Scripting

duplicate row based on single column

I am a newbie to shell scripting .. I have a .csv file. It has 1000 some rows and about 7 columns... but before I insert this data to a table I have to parse it and clean it ..basing on the value of the first column..which a string of phone number type... example below.. column 1 ... (2 Replies)
Discussion started by: mitr
2 Replies

4. Shell Programming and Scripting

Subtracting each row from the first row in a single column file using awk

Hi Friends, I have a single column data like below. 1 2 3 4 5 I need the output like below. 0 1 2 3 4 where each row (including first row) subtracting from first row and the result should print below like the way shown in output file. Thanks Sid (11 Replies)
Discussion started by: ks_reddy
11 Replies

5. Shell Programming and Scripting

Print unique names in each row of a specific column using awk

Is it possible to remove redundant names in the 4th column? input cqWE 100 200 singapore;singapore AZO 300 400 brazil;america;germany;ireland;germany .... .... output cqWE 100 200 singapore AZO 300 400 brazil;america;germany;ireland (4 Replies)
Discussion started by: quincyjones
4 Replies

6. Shell Programming and Scripting

Print every 5 4th column values as separate row with different first column

Hi, I have the following file, chr1 100 200 20 chr1 201 300 22 chr1 220 345 23 chr1 230 456 33.5 chr1 243 567 90 chr1 345 600 20 chr1 430 619 21.78 chr1 870 910 112.3 chr1 914 920 12 chr1 930 999 13 My output would be peak1 20 22 23 33.5 90 peak2 20 21.78 112.3 12 13 Here the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies

7. UNIX for Dummies Questions & Answers

Unique values in a row sum the next column in UNIX

Hi would like to ask you guys any advise regarding my problem I have this kind of data file.txt 111111111,20 111111111,50 222222222,70 333333333,40 444444444,10 444444444,20 I need to get this file1.txt 111111111,70 222222222,70 333333333,40 444444444,30 using this code I can... (6 Replies)
Discussion started by: reks
6 Replies

8. Shell Programming and Scripting

awk to filter out lines containing unique values in a specified column

Hi, I have multiple files that each contain four columns of strings: File1: Code: 123 abc gfh 273 456 ddff jfh 837 789 ghi u4u 395 File2: Code: 123 abc dd fu 456 def 457 nd 891 384 djh 783 I want to compare the strings in Column 1 of File 1 with each other file and Print in... (3 Replies)
Discussion started by: owwow14
3 Replies

9. Shell Programming and Scripting

Bring values in the second column into single line (comma sep) for uniq value in the first column

I want to bring values in the second column into single line for uniq value in the first column. My input jvm01, Web 2.0 Feature Pack Library jvm01, IBM WebSphere JAX-RS jvm01, Custom01 Shared Library jvm02, Web 2.0 Feature Pack Library jvm02, IBM WebSphere JAX-RS jvm03, Web 2.0 Feature... (10 Replies)
Discussion started by: kchinnam
10 Replies

10. UNIX for Beginners Questions & Answers

Find unique values but only in column 1

Hi All, Does anyone have any suggestions/examples of how i could show only lines where the first field is not duplicated. If the first field is listed more than once it shouldnt be shown even if the other columns make it unique. Example file : 876,RIBDA,EC2 876,RIBDH,EX7 877,RIBDF,E28... (4 Replies)
Discussion started by: mutley2202
4 Replies
WPA_SUPPLICANT.CONF(5)													    WPA_SUPPLICANT.CONF(5)

NAME
       wpa_supplicant.conf - configuration file for wpa_supplicant

OVERVIEW
       wpa_supplicant  is  configured using a text file that lists all accepted networks and security policies, including pre-shared keys. See the
       example configuration file, probably in /usr/share/doc/wpa_supplicant/, for detailed information about the configuration  format  and  sup-
       ported fields.

       All  file  paths  in  this  configuration file should use full (absolute, not relative to working directory) path in order to allow working
       directory to be changed. This can happen if wpa_supplicant is run in the background.

       Changes to configuration file can be reloaded be sending SIGHUP	signal	to  wpa_supplicant  ('killall  -HUP  wpa_supplicant').	Similarly,
       reloading can be triggered with the wpa_cli reconfigure command.

       Configuration  file can include one or more network blocks, e.g., one for each used SSID. wpa_supplicant will automatically select the best
       network based on the order of network blocks in the configuration  file,  network  security  level  (WPA/WPA2  is  preferred),  and  signal
       strength.

QUICK EXAMPLES
       1. WPA-Personal (PSK) as home network and WPA-Enterprise with EAP-TLS as work network.

	  # allow frontend (e.g., wpa_cli) to be used by all users in 'wheel' group
	  ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
	  #
	  # home network; allow all valid ciphers
	  network={
	       ssid="home"
	       scan_ssid=1
	       key_mgmt=WPA-PSK
	       psk="very secret passphrase"
	  }
	  #
	  # work network; use EAP-TLS with WPA; allow only CCMP and TKIP ciphers
	  network={
	       ssid="work"
	       scan_ssid=1
	       key_mgmt=WPA-EAP
	       pairwise=CCMP TKIP
	       group=CCMP TKIP
	       eap=TLS
	       identity="user@example.com"
	       ca_cert="/etc/cert/ca.pem"
	       client_cert="/etc/cert/user.pem"
	       private_key="/etc/cert/user.prv"
	       private_key_passwd="password"
	  }

       2. WPA-RADIUS/EAP-PEAP/MSCHAPv2	with RADIUS servers that use old peaplabel (e.g., Funk Odyssey and SBR, Meetinghouse Aegis, Interlink RAD-
	  Series)

	  ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
	  network={
	       ssid="example"
	       scan_ssid=1
	       key_mgmt=WPA-EAP
	       eap=PEAP
	       identity="user@example.com"
	       password="foobar"
	       ca_cert="/etc/cert/ca.pem"
	       phase1="peaplabel=0"
	       phase2="auth=MSCHAPV2"
	  }

       3. EAP-TTLS/EAP-MD5-Challenge configuration with anonymous identity for the unencrypted use. Real identity is sent only within an encrypted
	  TLS tunnel.

	  ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
	  network={
	       ssid="example"
	       scan_ssid=1
	       key_mgmt=WPA-EAP
	       eap=TTLS
	       identity="user@example.com"
	       anonymous_identity="anonymous@example.com"
	       password="foobar"
	       ca_cert="/etc/cert/ca.pem"
	       phase2="auth=MD5"
	  }

       4. IEEE 802.1X (i.e., no WPA) with dynamic WEP keys (require both unicast and broadcast); use EAP-TLS for authentication

	  ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
	  network={
	       ssid="1x-test"
	       scan_ssid=1
	       key_mgmt=IEEE8021X
	       eap=TLS
	       identity="user@example.com"
	       ca_cert="/etc/cert/ca.pem"
	       client_cert="/etc/cert/user.pem"
	       private_key="/etc/cert/user.prv"
	       private_key_passwd="password"
	       eapol_flags=3
	  }

       5. Catch  all example that allows more or less all configuration modes. The configuration options are used based on what security policy is
	  used in the selected SSID. This is mostly for testing and is not recommended for normal use.

	  ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
	  network={
	       ssid="example"
	       scan_ssid=1
	       key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE
	       pairwise=CCMP TKIP
	       group=CCMP TKIP WEP104 WEP40
	       psk="very secret passphrase"
	       eap=TTLS PEAP TLS
	       identity="user@example.com"
	       password="foobar"
	       ca_cert="/etc/cert/ca.pem"
	       client_cert="/etc/cert/user.pem"
	       private_key="/etc/cert/user.prv"
	       private_key_passwd="password"
	       phase1="peaplabel=0"
	       ca_cert2="/etc/cert/ca2.pem"
	       client_cert2="/etc/cer/user.pem"
	       private_key2="/etc/cer/user.prv"
	       private_key2_passwd="password"
	  }

       6. Authentication for wired Ethernet. This can be used with wired or roboswitch interface (-Dwired or -Droboswitch on command line).

	  ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
	  ap_scan=0
	  network={
	       key_mgmt=IEEE8021X
	       eap=MD5
	       identity="user"
	       password="password"
	       eapol_flags=0
	  }

CERTIFICATES
       Some EAP authentication methods require use of certificates. EAP-TLS uses both server side and client  certificates  whereas  EAP-PEAP  and
       EAP-TTLS  only require the server side certificate. When client certificate is used, a matching private key file has to also be included in
       configuration. If the private key uses a passphrase, this has to be configured in wpa_supplicant.conf ("private_key_passwd").

       wpa_supplicant supports X.509 certificates in PEM and DER formats. User certificate and private key can be included in the same file.

       If the user certificate and private key is received in PKCS#12/PFX format, they need  to  be  converted	to  suitable  PEM/DER  format  for
       wpa_supplicant. This can be done, e.g., with following commands:

	      # convert client certificate and private key to PEM format
	      openssl pkcs12 -in example.pfx -out user.pem -clcerts
	      # convert CA certificate (if included in PFX file) to PEM format
	      openssl pkcs12 -in example.pfx -out ca.pem -cacerts -nokeys

SEE ALSO
       wpa_supplicant(8) openssl(1)

								 07 November 2012					    WPA_SUPPLICANT.CONF(5)
All times are GMT -4. The time now is 04:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy