Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Pivoting values from column to rows Post 302995935 by Don Cragun on Saturday 15th of April 2017 05:27:15 AM
Old 04-15-2017
Quote:
Originally Posted by Booo
Can we replace the empty spaces in the column to zero. If its empty while sending as an excel format the empty column is copied by adjacent column data.
Yes. You can do that by changing 1 character in my suggestion or by adding 2 characters (4 if you add spaces around arithmetic operators) to either of our suggestions.

Can we know which of our suggestions you're using?

Can we know what fails in the suggestions that have been provided for you? (In other words, please explain in what way the suggestions you were given did not do what you requested in the requirements you stated before adding your new requirement in post #11?)

Can you try to modify the code we have supplied instead of expecting us to change our code for you every time you change your requirements? If you can't get it to work, show us what you have a tried an we'll be glad to help you finish it.
This User Gave Thanks to Don Cragun For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pivoting Dynamic rows into columns

Original file we are getting ....... Item Period Amt P1 106 1000 P1 206 1500 P1 106 2000 P2 256 5800 P2 650 7500 My output should be like this Item 106 206 256 650 ............ P1 1000 1500 0 ... (1 Reply)
Discussion started by: dprakash
1 Replies

2. Shell Programming and Scripting

How to consolidate values in one column from different rows into one?

Hi Guys, Thank you all for helping me with my different queries and I continue to get better at scripting because of help from all of you! I have a file that would look something like - ID SUB ID VALUE 1 10 5 2 18 7 1 ... (1 Reply)
Discussion started by: sncoupons
1 Replies

3. UNIX for Dummies Questions & Answers

How to assign scores to rows based on column values

Hi, I'm trying to assign a score to each row which will allow me to identify which rows differ. In the example file below, I've used "," to indicate column separators (my actual file has tab separators). In this example, I'd like to identify that row 1 and row 5 are the same, and row 2 and row... (4 Replies)
Discussion started by: auburn
4 Replies

4. UNIX for Dummies Questions & Answers

count number of rows based on other column values

Could anybody help with this? I have input below ..... david,39 david,39 emelie,40 clarissa,22 bob,42 bob,42 tim,32 bob,39 david,38 emelie,47 what i want to do is count how many names there are with different ages, so output would be like this .... david,2 emelie,2 clarissa,1... (3 Replies)
Discussion started by: itsme999
3 Replies

5. Shell Programming and Scripting

join rows based on the column values

Hi, Please help me to convert the input file to a new one. input file: -------- 1231231231 3 A 4561223343 0 D 1231231231 1 A 1231231231 2 A 1231231231 4 D 7654343444 2 A 4561223343 1 D 4561223343 2 D the output should be: -------------------- 1231231231 3#1#2 A 4561223343 0 D... (3 Replies)
Discussion started by: vsachan
3 Replies

6. Shell Programming and Scripting

Transposing rows and columns (pivoting) using shell scripting

Here is the contents of an input file. A,1,2,3,4 10,aaa,bbb,ccc,ddd 11,eee,fff,ggg,hhh 12,iii,jjj,lll,mmm 13,nnn,ooo,ppp I wanted the output to be A 10 1 aaa 10 2 bbb 10 3 ccc 10 4 ddd 11 1 eee 11 2 fff 11 3 ggg 11 4 hhh ..... and so on How to do it in ksh... (9 Replies)
Discussion started by: ksatish89
9 Replies

7. Shell Programming and Scripting

Remove rows with e column values

Hi All, I have a big file with 232 columns and 9 million rows, I want to delete all rows with same column values in col3 through col232. Also the output should be sorted based on first 2 columns. Here is a reduced example with 6 columns. I want to remove rows with duplicate values in col3... (9 Replies)
Discussion started by: alpesh
9 Replies

8. Shell Programming and Scripting

Choosing rows based on column values

I have a .csv file: A,B,0.6 C,D,-0.7 D,E,0.1 A,E,0.45 D,G, -0.4 I want to select rows based on the values of the 3rd columns such that it is >=0.5 or <= -0.5 Thanks. A,B,0.6 D,G, -0.7 (1 Reply)
Discussion started by: Sanchari
1 Replies

9. Shell Programming and Scripting

Convert Column data values to rows

Hi all , I have a file with the below content Header Section employee|employee name||Job description|Job code|Unitcode|Account|geography|C1|C2|C3|C4|C5|C6|C7|C8|C9|Csource|Oct|Nov|Dec|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep Data section ... (1 Reply)
Discussion started by: Hypesslearner
1 Replies

10. UNIX for Beginners Questions & Answers

Compare values in multiple rows in one column using awk

I would like to compare values in column 8, and grep the ones where the different is > 1, columns 1 and 2 are the key for array. Every 4 rows the records values in columns 1 and 2 changed. Then, the comparison in the column 8 need to be done for the 4 rows everytime columns 1 and 2 changed ... (4 Replies)
Discussion started by: jiam912
4 Replies
PSPELL_NEW_PERSONAL(3)							 1						    PSPELL_NEW_PERSONAL(3)

pspell_new_personal - Load a new dictionary with personal wordlist

SYNOPSIS
int pspell_new_personal (string $personal, string $language, [string $spelling], [string $jargon], [string $encoding], [int $mode]) DESCRIPTION
pspell_new_personal(3) opens up a new dictionary with a personal wordlist. The wordlist can be modified and saved with pspell_save_wordlist(3), if desired. However, the replacement pairs are not saved. In order to save replacement pairs, you should create a config using pspell_config_create(3), set the personal wordlist file with pspell_config_personal(3), set the file for replacement pairs with pspell_config_repl(3), and open a new dictionary with pspell_new_config(3). For more information and examples, check out inline manual pspell website:http://aspell.net/. PARAMETERS
o $personal - The file where words added to the personal list will be stored. It should be an absolute filename beginning with '/' because otherwise it will be relative to $HOME, which is "/root" for most systems, and is probably not what you want. o $language - The language code which consists of the two letter ISO 639 language code and an optional two letter ISO 3166 country code after a dash or underscore. o $spelling - The requested spelling for languages with more than one spelling such as English. Known values are 'american', 'british', and 'canadian'. o $jargon - Extra information to distinguish two different words lists that have the same language and spelling parameters. o $encoding - The encoding that words are expected to be in. Valid values are utf-8, iso8859-*, koi8-r, viscii, cp1252, machine unsigned 16, machine unsigned 32. o $mode - The mode in which spellchecker will work. There are several modes available: o PSPELL_FAST - Fast mode (least number of suggestions) o PSPELL_NORMAL - Normal mode (more suggestions) o PSPELL_BAD_SPELLERS - Slow mode (a lot of suggestions) o PSPELL_RUN_TOGETHER - Consider run-together words as legal compounds. That is, "thecat" will be a legal compound, although there should be a space between the two words. Changing this setting only affects the results returned by pspell_check(3); pspell_suggest(3) will still return suggestions. Mode is a bitmask constructed from different constants listed above. However, PSPELL_FAST, PSPELL_NORMAL and PSPELL_BAD_SPELLERS are mutually exclusive, so you should select only one of them. RETURN VALUES
Returns the dictionary link identifier for use in other pspell functions. EXAMPLES
Example #1 pspell_new_personal(3) <?php $pspell_link = pspell_new_personal ("/var/dictionaries/custom.pws", "en", "", "", "", PSPELL_FAST|PSPELL_RUN_TOGETHER); ?> PHP Documentation Group PSPELL_NEW_PERSONAL(3)
All times are GMT -4. The time now is 06:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy