Sponsored Content
Full Discussion: Pivot Column using awk
Top Forums Shell Programming and Scripting Pivot Column using awk Post 302933017 by Don Cragun on Tuesday 27th of January 2015 03:33:11 AM
Old 01-27-2015
In addition to what anbu23 has already requested, please also tell us some more information:
  1. Are the input file field2 values always the same, or do the headings in the output file have to be determined from the input file?
  2. If the headings have to be determined from the input, do the headings have to be sorted alphabetically?
  3. Are all input records for a given Party_ID adjacent in your input files (as they are in your sample input)?
  4. Are Party_ID values all numeric?
  5. Does the output need to be sorted by Party_ID, or can the output be in the same order as your input data?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

for each different entry in column 1 extract maximum values from column 2 in unix/awk

Hello, I have 2 columns (1st column has multiple entries but the corresponding values in the column 2 may be the same or different.) however I want to extract unique values for each entry in column 1 by assigning the max value from column 2 SDF4 -0.211654 SDF4 0.978068 ... (1 Reply)
Discussion started by: Diya123
1 Replies

2. Shell Programming and Scripting

Help newbie: transposing column into row (pivot)

Hi, I have a file in this format. Name | organization John | INT Abby| DOM John | DOM John | MIX Jason | INT Anna | DOM Abby |MIX I want the output to look this. Name | organization John | INT, DOM, MIX Abby | DOM, MIX Jason | INT Anna | DOM (5 Replies)
Discussion started by: sirrtuan
5 Replies

3. Shell Programming and Scripting

AWK script to create max value of 3rd column, grouping by first column

Hi, I need an awk script (or whatever shell-construct) that would take data like below and get the max value of 3 column, when grouping by the 1st column. clientname,day-of-month,max-users ----------------------------------- client1,20120610,5 client2,20120610,2 client3,20120610,7... (3 Replies)
Discussion started by: ckmehta
3 Replies

4. Shell Programming and Scripting

awk Print New Column For Every Two Lines and Match On Multiple Column Values to print another column

Hi, My input files is like this axis1 0 1 10 axis2 0 1 5 axis1 1 2 -4 axis2 2 3 -3 axis1 3 4 5 axis2 3 4 -1 axis1 4 5 -6 axis2 4 5 1 Now, these are my following tasks 1. Print a first column for every two rows that has the same value followed by a string. 2. Match on the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies

5. Shell Programming and Scripting

Pivot using awk

Hi, I am writing a code to basically pivot the data. awk -v var1="" -v var2="" -v var3="" -v var4="" -v var5="" -v Disp=0\ 'BEGIN {FS=":"; OFS="|";}\ /^Pattern1/ {var1=$2;Disp=0;} \ /^Pattern2/ {var2=$2;} \ /^Pattern3/ {var3=$2;} \ /^Pattern4/ {var4=$2;} \ /^Pattern5/... (5 Replies)
Discussion started by: tostay2003
5 Replies

6. Shell Programming and Scripting

Problems with awk (fatal error) and paste (two variables into one column-by-column)

Hello, I have a script extracting columns of useful numbers from a data file, and manipulating the numbers with awk commands. I have problems with my script... 1. There are two lines assigning numbers to $BaseForAveraging. If I use the commented line (the first one) and let the second one... (9 Replies)
Discussion started by: vgbraymond
9 Replies

7. Shell Programming and Scripting

Pivot data using awk

Hi My Input is like below DELETE|MPI|AUD_UPD_AGENT|MPISYS INSERT|MPI|AUD_UPD_AGENT|MPISYS SELECT|MPI|AUD_UPD_AGENT|MPISYS UPDATE|MPI|AUD_UPD_AGENT|MPISYS DELETE|MPI|BDYMOD|MPISYS INSERT|MPI|BDYMOD|MPISYS SELECT|MPI|BDYMOD|MPISYS UPDATE|MPI|BDYMOD|MPISYS DELETE|MPI|BDYMOD_DESC|MPISYS... (4 Replies)
Discussion started by: dineshaila
4 Replies

8. Shell Programming and Scripting

Awk- Pivot Table Averages

Hi everyone, Has anyone figured out yet how to do pivot table averages using AWK. I didn't see anything with regards to doing averages. For example, suppose you have the following table with various individuals and their scores in round1 and round2: SAMPLE SCORE1 SCORE2 British ... (6 Replies)
Discussion started by: Geneanalyst
6 Replies

9. Shell Programming and Scripting

awk to Sum columns when other column has duplicates and append one column value to another with Care

Hi Experts, Please bear with me, i need help I am learning AWk and stuck up in one issue. First point : I want to sum up column value for column 7, 9, 11,13 and column15 if rows in column 5 are duplicates.No action to be taken for rows where value in column 5 is unique. Second point : For... (1 Reply)
Discussion started by: as7951
1 Replies

10. Shell Programming and Scripting

awk script to append suffix to column when column has duplicated values

Please help me to get required output for both scenario 1 and scenario 2 and need separate code for both scenario 1 and scenario 2 Scenario 1 i need to do below changes only when column1 is CR and column3 has duplicates rows/values. This inputfile can contain 100 of this duplicated rows of... (1 Reply)
Discussion started by: as7951
1 Replies
GENERATELORE(1) 														   GENERATELORE(1)

NAME
lore - convert documentations formats SYNOPSIS
lore [-l linkrel] [-d docsdir] [-i input] [-o output] [--config attribute[=value] [...]] [-p] [file [...]] lore --help DESCRIPTION
The --help prints out a usage message to standard output. -p, --plain Use non-flashy progress bar - one file per line. -n, --null Do not report progress at all. -N, --number Add chapter/section numbers to section headings. -l, --linkrel Where non-document links should be relative to. -d, --docsdir Where to look for .html files if no files are given. -e, --inputext <extension> The extension that your Lore input files have (default: .xhtml) -i, --input Input format. New input formats can be dynamically registered. Lore itself comes with "lore" (the standard format), "mlore" (allows LaTeX equations) and "man" (man page format). If the input format is not registered as a plugin, a module of the named input will be searched. For example, --i twisted.lore.default is equivalent to using the default Lore input. -o, --output Output format. Available output formats depend on the input. For the core formats, lore and mlore support html, latex and lint, while man allows lore. -x, --index <filename> The base filename you want to give your index file. -b, --book <filename> The book file to generate a book from. --prefixurl <prefix> The prefix to stick on to relative links; only useful when processing directories. --version Display version information and exit. --config Add input/output-specific information. HTML output allows for 'ext=<extension>', output allows for 'section' or 'chapter' in Lore, and nothing in Math-Lore. Lore output allows for 'ext=<extension>'. Lint output allows nothing. Note that disallowed --config options are merely ignored, and do not cause errors. DESCRIPTION
If no files are given, all *.html documents in docsdir are processed. AUTHOR
Written by Moshe Zadka REPORTING BUGS
To report a bug, visit http://twistedmatrix.com/bugs/ COPYRIGHT
Copyright (C) 2003-2008 Twisted Matrix Laboratories. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. October 2002 GENERATELORE(1)
All times are GMT -4. The time now is 05:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy