Sponsored Content
Top Forums Shell Programming and Scripting More a logic than a programming question Post 302886584 by dietmar13 on Sunday 2nd of February 2014 06:06:32 AM
Old 02-02-2014
More a logic than a programming question

hello,

I'm a littlebit lost...

i have a table of single names and combination of two names and i want a table of ALL single names with ALL combinations (also the indirect ones).

- - - in reality the names are longer, not only a,b,.. and the table is tab-delimited, and the result table should also be tab-delimited - - -

input (is NOT sorted, only here for demonstration)
Code:
a
b
b c
c
c d
d
d c
e
f
f e
g
g c
h

output
Code:
 
a a
b b,c,d,g
c b,c,d,g
d b,c,d,g
e e,f
f e,f
g b,c,d,g
h h

Result: remove all redundancies, show all connections and sorted second column.

probably someone can give me some hints and code snippets (i know awk a little bit and can finish the program...)

thanks a lot,

dietmar

Last edited by dietmar13; 02-02-2014 at 07:37 AM.. Reason: addition
 

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parent/Child Scripting logic Question

I have Parent script that will execute a child script. The child script will take about 2 hours to run and I wanted to somehow build a logic for parent.sh to wait and perform ps -ef|grep cp|grep -v on the child.sh cp process and loop and check return code of child.sh $? as well. Once they are both... (3 Replies)
Discussion started by: jigarlakhani
3 Replies

2. Shell Programming and Scripting

need a logic for awk programming

Hello Friends, I have a txt file like below //*Init Start Reg(read,12'h42E,16'h0000); Nop(5628.5); //*Init End //*Main Start Reg(read,12'h42E,16'h0000); Nop(5628.5); //*Main End I want to calculate the values between //* Init Start & //* Init End And //*Main Start & //*Main... (5 Replies)
Discussion started by: user_prady
5 Replies

3. Shell Programming and Scripting

logic question

Hi, this is logic question, not sure anyone can answer I have 5 balls, and balance in front of me, this 5 balls look the same, but one of them is heavier, I need to use balance to find the heavier ball my approach is take any 2 balls, 2 balls in each side of balance, if the weight the same,... (2 Replies)
Discussion started by: ccp
2 Replies

4. Shell Programming and Scripting

Programming logic help

Hi, I was having a problem regarding this thread: https://www.unix.com/shell-programming-scripting/225221-setting-variable-using-variables-loop.html I have not been able to solve that issue. So i was thinking maybe my logic to solve the overall problem is wrong, so i am looking for a bit of... (2 Replies)
Discussion started by: brunlea
2 Replies
alias(4)							   File Formats 							  alias(4)

NAME
alias - alias table file of encoding names SYNOPSIS
/usr/lib/iconv/alias DESCRIPTION
This file contains the alias table of encoding names for iconv_open(3C). The format of the alias table is as follows: "%s %s ", <variant encoding name>, <canonical encoding name> The string specified for the variant encoding name is case-insensitive. A line beginning with '#' is treated as a comment. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
iconv(3C), iconv_close(3C), iconv_open(3C), attributes(5) SunOS 5.11 2 Oct 2001 alias(4)
All times are GMT -4. The time now is 01:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy