Sponsored Content
Top Forums Shell Programming and Scripting Count The Number Of Delimiters using awk or better Post 302934306 by BrahmaNaiduA on Friday 6th of February 2015 05:25:39 AM
Old 02-06-2015
Thanks for your quick suggestions. How to shuffle the columns as well

Code:
Sample Data:
Sample Data: 12345678|ABN\|XYZ MED CHEM PTY. LTD.|C||100.00|22|AB"C\|Corp|"XYZ|CDEF"|

Expected Output Data: 12345678|C|ABN\|XYZ MED CHEM PTY. LTD.|22|AB"C\|Corp||100.00|"XYZ|CDEF"|

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to count number of delimiters in a file name

I have a list of files with names as "FULL_abcd_xyz_timestamp.txt" and "FULL_xx_abcd_xyz_timestamp.txt". I am writing a script with a 'for loop' to take each file, strip the "FULL" and "timestamp" from the file name and do some actions on the contains of the file. So I need to know the number of... (4 Replies)
Discussion started by: ayanbiswas
4 Replies

2. UNIX for Dummies Questions & Answers

count number of fields not using SED or AWK

hi forums i need help with a little problem i am having. i need to count the number of fields that are in a saved variable so i can use that number to make a different function work properly. is there a way of doing this without using SED/AWK? anything would be greatly appreciated (4 Replies)
Discussion started by: strasner
4 Replies

3. UNIX for Dummies Questions & Answers

how to count number of rows and sum of column using awk

Hi All, I have the following input which i want to process using AWK. Rows,NC,amount 1,1202,0.192387 2,1201,0.111111 3,1201,0.123456 i want the following output count of rows = 3 ,sum of amount = 0.426954 Many thanks (2 Replies)
Discussion started by: pistachio
2 Replies

4. Shell Programming and Scripting

Help with Unix and Awk to count number of occurrences

Hi, I have a file (movies.sh), this file contains list of movies such as I want to redirect the movies from movies.sh to file_to_process to allow me process the file with out losing anything. I have tried Movies.sh >> file_to_process But I want to add the row number to the data... (2 Replies)
Discussion started by: INHF
2 Replies

5. UNIX for Dummies Questions & Answers

count number of distinct values in each column with awk

Hi ! input: A|B|C|D A|F|C|E A|B|I|C A|T|I|B As the title of the thread says, I would need to get: 1|3|2|4 I tried different variants of this command, but I don't manage to obtain what I need: gawk 'BEGIN{FS=OFS="|"}{for(i=1; i<=NF; i++) a++} END {for (b in a) print b}' input ... (2 Replies)
Discussion started by: beca123456
2 Replies

6. Shell Programming and Scripting

count the number of instances in 2 columns using awk

Input A.1 Q.1 A.1 Q.2 A.1 Q.3 A.2 Q.4 Explanation: Final Output A.1 Q.1 s1 t1 A.1 Q.2 s1 t2 A.1 Q.3 s1 t3 A.2 Q.4 s5 t5 ---------- Post updated 09-28-12 at 03:38 AM ---------- Previous update was 09-27-12 at 09:10 AM ---------- Hi Guys, I was able to do until... (11 Replies)
Discussion started by: quincyjones
11 Replies

7. Shell Programming and Scripting

Count number of occurences using awk

Hi Guys, I have 2 files like below file1 xx yy file2 b yy b2 xx c1 yy xx yy Now I want an idea which can count occurences of text from file1 and file2 so outbout would be kind of (9 Replies)
Discussion started by: prashant2507198
9 Replies

8. Shell Programming and Scripting

How to count a number using awk?

hi, does any one know how to compare a file1 with many files and have to count a number (i.e. 1) like the following ..Thanx in advance input file1 file2 file3 filen 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 output instances in file1 only - 2 instances in... (3 Replies)
Discussion started by: quincyjones
3 Replies

9. Shell Programming and Scripting

Skip the delimiter with in double quotes and count the number of delimiters during data extract

Hi All, I'm stuck-up in finding a way to skip the delimiter which come within double quotes using awk or any other better option. can someone please help me out. Below are the details: Delimited: | Sample data: 742433154|"SYN|THESIS MED CHEM PTY.... (2 Replies)
Discussion started by: BrahmaNaiduA
2 Replies

10. Shell Programming and Scripting

Count Repetitive Number in a column and renumbering using awk

Unable to get the desired output. Need only the rows which has repeated values in column 5. Input File <tab separated file> chr1 3773797 3773797 CEP10 1 chr1 3773797 3773797 CEP104 2 chr1 3689350 3689350 SMIM1 2 chr1 3773797 3773797 CEP4 3 chr1 3773797 3773797 EP104 ... (7 Replies)
Discussion started by: himanshu
7 Replies
lldptool(8)							       Linux							       lldptool(8)

NAME
LLDP-MED - Show / manipulate MED TLV configurations SYNOPSIS
lldptool -t -i ethx -V [ TLV_TYPE ] enableTx lldptool -T -i ethx -V [ TLV_TYPE ] enableTx = { yes | no } lldptool -T -i ethx -V LLDP-MED devtype = { class1 | class2 | class3 } lldptool -t -i ethx -V LLDP-MED devtype TLV_TYPE : = {LLDP-MED | medCap | medPolicy | medLoc | medPower | medHwRev | medFwRev | medSwRev | medSerNum | medManuf | medModel | medAssetID } DESCRIPTION
The LLDP-MED extensions support the Link Layer Discovery Protocol for Media Endpoint Devices defined in the ANSI/TIA-1057-2006 document. Each TLV can be configured as a class1 , class2 or class3 device. Class I devices are the most basic class of Endpoint Device, Class II devices support media stream capabilities and Class III devices directly support end users of the IP communication system. See ANS-TIA-1057 for clarification of class types. ARGUMENTS
enableTx Enables the TLV to be transmitted devtype Set or query the class type of the device. TLV_TYPE List of supported TLV specifiers applicable to Media Endpoint Devices. LLDP-MED apply arguments to all supported MED TLVs. medCAP LLDP-MED Capabilities TLV medPolicy LLDP-MED Network Policy TLV medLoc LLDP-MED Location TLV medPower LLDP-MED Extended Power-via-MDI TLV medHwRev LLDP-MED Hardware Revision TLV medFwRev LLDP-MED Firmware Revision TLV medSwRev LLDP-MED Software Revision TLV medSerNum LLDP-MED Serial Number TLV medManuf LLDP-MED Manufacturer Name TL medModel LLDP-MED Model Name TLV medAssetID LLDP-MED Asset ID TLV EXAMPLE &; USAGE Enable class1 MED device on eth2 lldptool -T -i eth2 -V LLDP-MED enableTx=yes devtype=class1 Query class type of MED on eth2 lldptool -t -i eth2 -V LLDP-MED -c devtype Query transmit state of medPolicy on device eth2 lldptool -t -i eth2 -V medPolicy -c enableTx SOURCE o Link Layer Discovery Protocol for Media Endpoint Devices (http://www.tiaonline.org/standards/technology/voip/documents/ANSI- TIA-1057_final_for_publication.pdf) NOTES
SEE ALSO
lldptool(8), lldpad(8) AUTHOR
John Fastabend open-lldp June 2011 lldptool(8)
All times are GMT -4. The time now is 03:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy