Sponsored Content
Full Discussion: Reverse Arrange File
Top Forums UNIX for Dummies Questions & Answers Reverse Arrange File Post 302121266 by The One on Tuesday 12th of June 2007 10:38:49 PM
Old 06-12-2007
Reverse Arrange File

I've got hundreds of lines in a file that looks like this:

Line1 CCR CCH
Line2 ICVM FBO GSC
Line3 MKF

The result should be like the one below so that I can insert them on our database.

Line1 CCR
Line1 CCH
Line2 ICVM
Line2 FBO
Line2 GSC
Line3 MKF

Thanks in advance!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to read a file in reverse

I have to extract data from a text file which is huge in size >>10GB. ie between two strings. If I do an ordinary sed it takes forever to come out. I was wondering if there was anyway to do the entire process in reverse and on finding the relevant string is there any way to break out of the... (5 Replies)
Discussion started by: scorreg
5 Replies

2. Shell Programming and Scripting

how to arrange 3 file to one using awk...?

I have 3 file, I want to re-arrange so all data easy to read from one file only: file1 : userA 10 20 userB 30 40 userC 50 60 .... file2 : userA var1 1000 userA var2 2000 userB var2 3000 userB var3 4000 userB var4 5000 userC var1 6000 ... file3 : userA var3 7000 userA var4 8000 (9 Replies)
Discussion started by: penyu
9 Replies

3. UNIX for Advanced & Expert Users

How to reverse the contents of a file?

Hi Guys, Am new to this forum .... And also to shell scripting I need a k-shell script to reverse the contents of a file... Please come up with the solutions... With regards, Anand (10 Replies)
Discussion started by: aajan
10 Replies

4. Shell Programming and Scripting

how to reverse file

i am using AIX -ksh how can i reverse any file ,i have already try tac cmd it is not in AIX: please help me out. (3 Replies)
Discussion started by: RahulJoshi
3 Replies

5. Shell Programming and Scripting

how to arrange all lines in a file to a single line

Hi Gurus, I am a starter with shell script. Help me to achieve this. I have a file with lines given below. line1 line2 line3 . . etc How can I arrange the file which should look like line1,line2,line3,..,..,etc Any help on this is appreciated. (9 Replies)
Discussion started by: smv
9 Replies

6. Shell Programming and Scripting

script to arrange file in specific format

Hi All, I am new to forum, I am looking to arrange a file in specific format but unable to get the formula to do it, already googled for the same, but didnt find the answer :(. hope to get help here :o:o:o:o:o I have to files : $ cat Dev_List2 0685 0686 0687 0688 0689 068A 068B 068C... (2 Replies)
Discussion started by: prasan_Aix
2 Replies

7. UNIX for Dummies Questions & Answers

reverse first field from the file

Hi all, I have a file named file1as 07/25 00:10 d327490 07/25 00:55 d378299 07/25 03:58 d378299 07/25 06:14 d642035 07/25 12:44 c997126 and now i want to reverse the first filed ie 07/25 as 25/07 00:10 d327490 25/07 00:55 d378299 25/07 03:58 d378299 25/07 06:14 d642035 25/07... (5 Replies)
Discussion started by: zozoo
5 Replies

8. Shell Programming and Scripting

Shell scripting - need to arrange the columns from multiple file into a single file

Hi friends please help me on below, i have 5 files like below file1 is x 10 y 20 z 15 file2 is x 100 z 245 file3 is y 78 z 23 file4 is x 100 (3 Replies)
Discussion started by: siva kumar
3 Replies

9. Shell Programming and Scripting

Reverse Display of a file

Hi all, Just saw a "sed" format to reverse display the file contents, but am not geting its logic completely. I would appreciate if somebody can explain sed '1!G;h;$!d' < filename All I know in this is that : G will add a new line after every line except first one... (5 Replies)
Discussion started by: dextergenious
5 Replies

10. OS X (Apple)

Arrange file by modified date

Hi, Am performing a find based on filename and result can contain multiple files being found Let's say my find command is find /Archive -f -name 12345.pdf and result of find command is /Archive/Folder A/12345.pdf /Archive/Folder B/12345.pdf please note white space in folder names I... (2 Replies)
Discussion started by: gigagigosu
2 Replies
Devices(4)						     Kernel Interfaces Manual							Devices(4)

NAME
Devices - Contains information about devices on the local system that can establish a connection to a remote computer using the uucp pro- gram SYNOPSIS
/usr/lib/uucp/Devices DESCRIPTION
The /usr/lib/uucp/Devices file contains information about the devices on the local system that can establish a connection to a remote com- puter using the uucp program. This file includes information about hardwired, telephone, and TCP/IP communications links. Note that only someone with root user authority can edit the Devices file, which is owned by the uucp login ID. Fields in the Devices File The Devices file must contain a description of each device on the local system that can establish a remote connection using the uucp pro- gram. Each line in the Devices file includes the following fields: Typically specifies the type of hardwired (DIR) or Automatic Calling Unit (ACU) device. Specifies the device name for the port. Specifies the dialer name if the Line entry specifies an 801 dialer. Typi- cally specifies the transmission speed. Specifies a particular type of autodialer (modem) and the token (a defined string of characters) that is passed to the dialer. Valid entries for this field are defined in the /usr/lib/uucp/Dialers file. The fields appear on the line as follows: Type Line Line2 Class Dialer-Token Pairs There must be an entry in every field of a line in the Devices file. If a field does not apply to the particular type of device, use a - (dash) as a placeholder. Lines in the Devices file cannot wrap. Each entry must be on only one line in the file. However, the Devices file can contain blank lines and comment lines. Comment lines begin with a # (number sign). Blank lines are ignored. Enter one of the following keywords in the Type field: Use this keyword, entered in uppercase letters, if your site connects multiple systems over the telephone network using automatic calling units (autodialers or modems). Use this keyword if your site uses hardwired lines to connect multiple systems. Use this keyword if your site uses TCP/IP. Enter the name of a particular remote system hardwired to the local system. The SystemName keyword is the name assigned to each individual system; for example, hera, zeus, or merlin. This field corresponds to the Type field in the /usr/lib/uucp/Systems file. Enter the device name for the line, or port, used in the communications link. For example, use the appropriate tty device name for a hardwired line, such as tty01. For a line con- nected to an ACU (a modem), use a device name appropriate to the dialer, such as tty01 or tty0. For a TCP connection, enter a - (dash) as a placeholder. If you are using an 801 dialer, enter the device name of the 801 ACU in this field. For example, if the entry in the Type field is ACU and the Line field entry (specifying the modem) is tty0, the Line2 field entry (specifying the 801 dialer for the modem) might be tty01. If the device type is not 801, enter a - (dash) in this field as a placeholder. Note that the Line2 field is used only to support older modems that require 801-type dialers. The modem is plugged into one serial port, and the 801 dialer is plugged into a separate serial port. For an ACU or a hardwired line, the Class field can be the speed of the device. In this case, for a hardwired line, enter the transmission rate of the device connecting the two systems. For a telephone connection, enter the speed at which the ACU transmits data, such as 300 or 1200 bps. This field can also contain a letter with a speed (for example, C1200, D1200) to differentiate between classes of dialers. For example, some offices have more than one telephone network, one for internal use and one for external communications. In such a case, it is necessary to distinguish which lines should be used for each connection. For devices that can match any speed, you can specify Any in this field. The Class field in the Devices file is matched against the Class field in the /usr/lib/uucp/Systems file. For example, if the Sys- tems file entry for system hera is: hera Any ACU 1200 3-3-5-2 ogin: nuucp ssword: oldoaktree The uucp program searches for an entry in the Devices file with a Type of ACU and a Class of 1200. Some devices can be used at several speeds. In this case, make multiple entries for the device, specifying each speed on a separate line in the Devices file. If the uucp program cannot connect at the first speed, it will try the other speeds, one after another. For a TCP connection, enter a - (dash) as a placeholder. The Dialer-Token Pairs field specifies a particular type of autodialer (modem) and the token (a defined string of characters) that is passed to the dialer. Valid entries for this field are defined in the /usr/lib/uucp/Dialers file. For a hardwired connection, enter the word direct (note the lowercase d) as the Dialer entry and leave the Token entry blank. For a telephone connection, enter the type of dialer and the token that is passed on to that modem. The Token field entry is either a telephone number or a predefined string used to reach the dialer. For a telephone connection, enter one of the following as the Dialer field entry: A Hayes dialer. A Penril dialer. Other dialers that you can specify by including the relevant information in the /usr/lib/uucp/Dialers file. A TCP/IP connection. Enter TCP in the Dialer field entry if you have also entered TCP in the Type field. Each Dialer field entry included as part of a Dialer-Token Pairs field in the Devices file has a corresponding entry in the Dialers file. If the Token field entry represents a telephone number, enter one of the following in the Token field to specify how the uucp pro- gram should use the telephone number listed in the /usr/lib/uucp/Systems file: The default token in a Dialer-Token Pairs field. The D token specifies that the uucp program should take the phone number listed in the /usr/lib/uucp/Systems file and pass it to the appropriate dialer script (entry) in the /usr/lib/uucp/Dialers file without including a dial-code abbreviation. This token instructs the uucp program to process the phone number by including the data specified in the /usr/lib/uucp/Dialcodes file. Note that if you are using dial-code abbreviations specified in the Dialcodes file for certain telephone numbers, you must enter the T string as the token in those entries in the Dialers file. Leaving the Token field blank is the same as entering D, so a blank is usually sufficient as a token if you have included complete telephone numbers in the /usr/lib/uucp/Systems file. If the Token field does not represent a telephone number, enter the predefined string necessary to reach the dialer. Entries for Hardwired Connections In general, each entry for a hardwired connection consists of two lines. The first line specifies the port (line) that the uucp command uses to connect to the remote system. The second line specifies the remote system. However, if the two systems use a permanent virtual circuit connection, the entry is a single line in the Devices file. To set up a hardwired connection specifying a port and a remote system, make a 2-line entry as follows: Enter the keyword Direct, with an uppercase D, in the Type field in the first line of the entry. Enter the name of the remote system to which you want to connect the local computer over the hardwired line in the Type field in the second line of the entry. Enter the device name appropriate for the hardwired connection used at your site in the Line field in both lines of the entry. Enter a - (dash) for a placeholder in the Line2 field in both lines of the entry. Enter the transmission rate appropriate for the hardwired connection used at your site in the Class field in both lines of the entry. Enter direct (all lowercase) in the Dialer-Token Pairs field in both lines of the entry. To set up a hardwired connection between two systems that use a permanent virtual circuit connection, make a 1-line entry as follows: Enter the name of the remote system in the Type field. Enter the name of the permanent virtual circuit connection in the Line field. Enter a - (dash) for a placeholder in the Line2 field. Enter the transmission rate appropriate for the hardwired connection used at your site in the Class field. Enter direct (all lowercase) in the Dialer-Token Pairs field. Continue adding entries to the Devices file until you have listed each hardwired device connecting the local system to a remote system. Entries for Autodialer Connections In telephone-connection entries, the Type field is specified as an ACU. Enter ACU as the Type field entry in all remote connections established over a phone line. To set up Devices file entries for autodialer connections, make a 1-line entry for each modem as follows: Enter ACU in the Type field. The Line field contains the name of the device that is attached to the modem. Enter the device name appro- priate for your site. Enter a - (dash) as a placeholder in the Line2 field, unless the autodialer is a standard 801 dialer. If the auto- dialer is a standard 801 dialer, enter 801. In the Class field, enter the baud rate appropriate for your modem and line (this can be 300, 1200, 2400, or higher, depending on the modem) or the class of your modem (for example, D2400. Note that if the modem can be used at more than one rate, make a separate entry in the Devices file for each rate. Enter the name of the modem as the Dialer field entry in the Dialer-Token Pairs field. If you are planning to include complete phone numbers in the /usr/lib/uucp/Systems file, leave the Token field blank. (A blank instructs the uucp program to use the default D token.) If you are planning to use dial-code abbreviations specified in the /usr/lib/uucp/Dialcodes file, enter the T token. Continue adding entries to the Devices file until you have listed each connection between the local system and a remote system that uses a telephone line and a modem. Entries for Use with TCP/IP If your site is using the TCP/IP system, include the relevant TCP/IP entry in the Devices file. To set up the file for use with the TCP/IP system, enter a line in the Devices file as follows: Enter TCP in the Type field. Enter dashes in the Line, Line2, and Class fields. Enter TCP as the Dialer field entry and leave the Token field blank. EXAMPLES
Examples of Devices file entries for a number of situations are given below. Setting Up Entries for Hardwired Connections To set up a Devices file entry specifying a port and a remote system, enter: Direct tty0 - 1200 direct zeus tty0 - 1200 direct The Type field lists Direct (for a direct connection) in the first part and zeus (the name of the remote sys- tem) in the second part. The local system is connected to system zeus by way of device tty0, which is listed in the Line field in both parts of the example. The Line2 field contains actual data only when the entry specifies a certain type of telephone connection. A - (dash) is used as a placeholder in other types of connections, as is the case in this example. This tty device transmits at 1200 bps, which is listed in the Class field in both parts of the example. The word direct in the Dialer portion of the Dialer-Token Pairs field indicates that this is a direct connection. To set up a Devices file entry specifying a permanent virtual circuit connection, enter: odin tty01 - 9600 direct The Type field lists the name of the remote system, odin. The Line field contains the name of the permanent virtual circuit connection. A - (dash) is used as a placeholder in the Line2 field. This line transmits at 9600 bps, which is listed in the Class field. The word direct in the Dialer portion of the Dialer-Token Pairs field indicates that this is a direct connection. Setting Up Entries for Autodialer Connections For a standard Hayes modem that can be used at only one baud rate, enter: ACU tty2 - 1200 hayes The Type field is specified as ACU. The Line field is specified with the device name tty2. Because this modem is not an 801 dialer, a - (dash) is used as a placeholder in the Line2 field. The Class field entry is a transmission rate of 1200 baud. The Dialer part of the Dialer-Token Pairs field is specified as a hayes modem, and the Token part is left blank. To specify a standard Hayes modem that can be used at different baud rates, enter: ACU tty3 - 1200 hayes ACU tty3 - 300 hayes These two lines specify the same modem, a hayes modem that can be used at either 1200 or 300 baud, as specified in the Class field. The modem is connected to a device named tty3 (the Line field), and the Line2 field contains the - (dash) placeholder. The Dialer part of the Dialer-Token Pairs field is specified as a hayes modem, and the Token field is left blank. To specify a connection using a standard 801 dialer, enter: ACU tty4 tty5 1200 801 ACU tty6 tty7 300 801 In these entries, the ACU entries are connected to devices named tty4 and tty6, specified in the Line field. In both cases, there is an entry in the Line2 field because a standard 801 autodialer is specified in the Dialer-Token Pairs field. Because 801 is specified as the dialer in these two examples, the Line2 field must contain the device names of the 801 ACUs. The Class field entry is a transmission rate of 1200 baud for the first example and 300 for the second. The Token part of the Dialer-Token Pairs field is blank. Setting Up Entries for Use with TCP/IP If your site is using the TCP/IP system, enter the following in the Devices file: TCP - - - TCP TCP is specified in the Type field. Dashes are used as placeholders in the Line, Line2, and Class fields. TCP is specified as the Dialer field entry with the Token entry left blank. Setting Up Entries for Both Local and Remote Systems The following examples illustrate the entries needed in the Devices file for both local and remote systems in order for the two systems to communicate using the uucp program. The following entries configure local and remote Devices files for a hardwired connection between systems zeus and hera, where zeus is con- sidered the local system and hera is considered the remote system. The hardwired device is tty0. The Devices file on system zeus must contain the following entry in order to connect to the remote system hera: Direct tty0 - 1200 direct hera tty0 - 1200 direct The Devices file on system hera must contain the following entry for communications with system zeus: Direct tty0 - 1200 direct zeus tty0 - 1200 direct The following entries are set up to connect systems venus and merlin over a telephone line using modems. Sys- tem venus is considered the local system, and system merlin is considered the remote system. On both systems, the tty01 device is hooked to a hayes modem at 1200 baud. Both computers include partial phone numbers in their /usr/lib/uucp/Systems files and dialing codes in their /usr/lib/uucp/Dialcodes files. The Devices file on system venus must contain the following entry for the connection to system merlin: ACU tty01 - 1200 hayes T The Devices file on system merlin must contain the fol- lowing entry for the connection to system venus: ACU tty01 - 1200 hayes T FILES
Contains all the configuration files for the uucp program, including the Devices file Contains dial-code abbreviations Specifies initial handshaking on a connection Describes accessible remote systems RELATED INFORMATION
Daemons: uucico(8) Commands: cu(1), uucp(1), uuto(1), uux(1) delim off Devices(4)
All times are GMT -4. The time now is 02:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy