Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to create all possible combination of lines? Post 302200957 by sickboy on Friday 30th of May 2008 12:30:23 PM
Old 05-30-2008
How to create all possible combination of lines?

Hi,

I have a file where all the lines are sorted and uniq.
A part of it looks like

Code:
AAL
AAR
ABC
ABE
ABJ
ABQ
ABV
ABZ
ACC
ACE
ADA
ADB
ADD
ADL
AES

what I want to do is to create a new file which will contain all the possible combinations.

What I mean with simple abc example is

I have

a
b
c
d

and I want in my new file to have

a,b
a,c
a,d
b,a
b,c
b,d
c,a
c,b
c,d
d,a
d,b
d,c

I don't know how to do it.
Can somebody please advise?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to create one newfile and wants include some lines based on user request

I have one request, First it has to create one file and in that file it has to include some lines based on user request. Suppose user requested 10, then script needs to add 10 lines like below QAEVO_A1|A1 QAEVO_A2|A2 QAEVO_A3|A3 QAEVO_A4|A4 QAEVO_A5|A5 QAEVO_A6|A6 QAEVO_A7|A7... (8 Replies)
Discussion started by: sridhusha
8 Replies

2. Shell Programming and Scripting

need to create lines from ones that begin with the field separator

Hello, I need to modify an awk script to recognize the last field $NF when the line is split over more than 1 line. In my input file the field separator is the exclamation mark ! so FS="!" So here is my input file infile.txt, it has 2 records, the field separator is in bold: INPUT ... (6 Replies)
Discussion started by: script_op2a
6 Replies

3. Shell Programming and Scripting

Wrap lines with awk to create SQL script

Greetings! Some of my files list hardware errors (we test electronic components), some have none. If the file name has no errors, I still want to display a message like "No error", else I display the error from the file itself. I came up with this (with help) for myfile in `find . -name... (2 Replies)
Discussion started by: alan
2 Replies

4. Shell Programming and Scripting

Create new lines using a delimited string.

Hi I have a text file called 'fileA' which contains the follwoing line examples 01:rec1:25,50,75,100 02:rec2:30,60 03:rec3:20,40 I would like to create a new file where each of the comma separated values appears on a new line but prefixed with the first two fields e.g. 01:rec1:25... (3 Replies)
Discussion started by: mackmb
3 Replies

5. Shell Programming and Scripting

Ignoring lines and create new file

Hello, I have a requirement to ignore few lines in a file before keyword FILEHEADER . As soon as there is keyword FILEHEADER is identified in file , it will form another file with data from FILEHEADER to whatever in file after FILEHEADER. I wrote filename=$1 awk... (4 Replies)
Discussion started by: callmatkarna
4 Replies

6. Shell Programming and Scripting

Please help, need to create script to remove lines by date in file

Please Help (novice to PERL and SHELL scripting)…. Need to create a script which removes all lines in $filename = "cycle_calendar_ftp_out" older than current date – a variable which will be a number of days passed to script. For Ex it will look at the end date which is the last field (4) and... (2 Replies)
Discussion started by: m3pwr
2 Replies

7. Shell Programming and Scripting

How to create a file contains millions of lines and each line has different datas?

I want to create a file contains millions of lines. The line format like this: acnum$$123456$$+$$Tom$$111$$ fields separated by $$, field 1 and field 3 have only two options:acnum or crenum; + or -. field 4 can be any name or any letters. Other fields can be any fixed length digits. So, I want to... (9 Replies)
Discussion started by: hhdzhu
9 Replies

8. Shell Programming and Scripting

Read Lines from One file.. and create another.. and

Hello Members, I have one file which contains million of supplier code. I need to load these codes into database 1000 at a time. Database procedure reads from an external table which is based on the unix files. All I want to do is to read from the bigger file e.g. MAIN_FILE.txt and create... (1 Reply)
Discussion started by: chetanojha
1 Replies

9. Shell Programming and Scripting

awk or a combination of commands to read and calculate nth lines from pattern

Two numerical lines, found by either header line, need to be added and the total placed in a new-header section. Also the total should should be rounded or cut to a two decimal anynumber.XX format with the AB string added on the end. For example: The numerical lines from headers 2 and 3 are... (3 Replies)
Discussion started by: jessandr
3 Replies

10. UNIX for Beginners Questions & Answers

Create 'n' number random pairwise combination of words

File 1 contains the list of words that needed to be randomly paired: Tiger Cat Fish Frog Dog Mouse Elephant Monkey File 2 contains the pairs that should not be used (in any solution) during random pairing. Elephant-Dog Cat-Fish Monkey-Frog Dog-Elephant, Fish-Cat, Frog-Monkey... (1 Reply)
Discussion started by: sammy777888
1 Replies
ADB(4)							   BSD Kernel Interfaces Manual 						    ADB(4)

NAME
adb -- Apple Desktop Bus driver SYNOPSIS
adb* at obio? options MRG_ADB #include <machine/adbsys.h> DESCRIPTION
The Apple Desktop Bus (ADB) is the single-master, multiple-slave, low-speed serial bus interface used by Macintosh computers to connect input devices such as keyboards, mice, trackpads, trackballs, and graphics tablets to the machine. NetBSD provides support for the Apple Desktop Bus as found on all supported mac68k models, as well as macppc models with on-board ADB (PowerBooks and ``Old World'' models). The adb driver accesses the ADB controller using the so-called ``HWDIRECT'' method. This method of access bypasses the Macintosh ROM and uses only NetBSD routines for ADB access. This is the only method supported on macppc and is the default for mac68k systems. On mac68k systems there is an alternate method of accessing the ADB controller. With the Macintosh ROM Glue (MRG) method, the routines writ- ten for MacOS are used. To enable this method of ADB access, uncomment the line: options MRG_ADB in your kernel configuration file. The ioctl(2) call is used to control the ADB event device. The following is a list of available ioctl(2) commands: ADBIOC_DEVSINFO Get ADB Device Info The adb event device will return an array of information containing an entry for each device connected to the bus. Each entry contains the current address, default address, and handler ID for the corresponding ADB device. ADBIOC_GETREPEAT Get Keyboard Repeat Info Returns a structure containing the current keyboard repeat delay and keyboard repeat interval. ADBIOC_SETREPEAT Set Keyboard Repeat Rate Sets the keyboard repeat delay and interval to the values specified by argp. ADBIOC_RESET ADB Reset Perform a reset of the ADB which will reinitialize all of the devices attached to the bus. ADBIOC_LISTENCMD ADB Listen Command Send data to the register of the ADB device specified by argp. This command is not fully implemented at this time. SUPPORTED DEVICES
NetBSD includes support for the following ADB devices, sorted by driver name: abtn ADB mouse button? aed ADB event device akbd ADB keyboard ams ADB mouse apm APM emulation FILES
/dev/adb The ADB event device. DIAGNOSTICS
aed0 at adb0 addr 0: ADB Event device This is a normal autoconfiguration message noting the presence of the adb event device. adb0 at obio0 offset 0x16000 irq 18: 2 targets A standard autoconfiguration message indicating the initialization of the ADB subsystem. adb: no devices found. No ADB devices were found to be connected to the bus during autoconfiguration. adb: using %s series hardware support. Indicates the class of ADB hardware support the machine uses. adb: hardware type unknown for this machine. The ADB hardware in this machine is currently unsupported. adb: no ROM ADB driver in this kernel for this machine. The kernel lacks the necessary Macintosh ROM Glue (MRG) support for accessing the ADB hardware on this machine. adb: using serial console. A serial console will be used for user input rather than the ADB event device. adb: %s at %d. An ADB device of the type specified by %s has been found at location %d. SEE ALSO
aed(4), akbd(4), ams(4), apm(4) HISTORY
The adb interface first appeared in NetBSD 0.9. It has been under development ever since. AUTHORS
Bradley A. Grantham wrote the original adb driver, including the MRG support. The hardware direct interface was written by John P. Wit- tkowski. The PowerManager interface was written by Takashi Hamada. BUGS
o Not every class of ADB hardware is supported yet. o The talk command is currently unimplemented. o The listen command is not implemented yet. o Not all multi-button mice are currently supported. o Only mapped and relative-position ADB devices (i.e. keyboards and mice) are supported. Thus absolute-position and other exotic devices will not work. o Some of the diagnostic messages in this man page need to be updated. Some mac68k machines contain so-called dirty ROM. These machines are the: Mac SE/30, Mac II, Mac IIx, and Mac IIcx. Machines with dirty ROM may experience trouble booting if the MRG code is used, especially under the following conditions: o Both a keyboard and a mouse are not attached to the computer. o An extended keyboard is attached to the computer. On (some) machines with dirty ROM, the ROM indicates the presence of a ``ghost'' keyboard or mouse. When this non-existant device is probed for, the result is an infinite loop. This is believed to be triggered by the adb driver probing for extended mice, and non-EMP Logitech mice. BSD
September 21, 2003 BSD
All times are GMT -4. The time now is 09:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy