Sponsored Content
Top Forums Shell Programming and Scripting Joining lines in reverse. append line 1 to line 2. Post 302220316 by dwalley on Thursday 31st of July 2008 11:55:40 AM
Old 07-31-2008
Joining lines in reverse. append line 1 to line 2.

Hi I have used many times the various methods to append two lines together in a file.

This time I want to append the 1st line to the second and repeat for the complete file.... an example

This is the file

owns the big brown dog
joe
owns the small black dog
jim

What I want is

joe owns the big brown dog
jim owns the small black dog

Thanks. Dave
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Joining lines to single line in VI

Dear friends, In VI, I have these data shown below: Line1 Line2 Line3 Line4 How can I JOIN these line to the first line? When I finished I should have: Line1 Line2 Line3 Line4 is there a text length limit of how long a single line can be in VI? Thank you much! (10 Replies)
Discussion started by: bobo
10 Replies

2. Shell Programming and Scripting

Joining contents in multiple lines to a single line

I do have a file with contents splited into multiple lines ADSLHLJASHGLJSKAGHJJGAJSLGAHLSGHSAKBV AJHALHALHGLAGLHGBJVFBJVLFDHADAH GFJAGJAGAJFGAKGAKGFAK AJHFAGAKAGAGKAKAKGKAGFGJDGDJJDGJDJDFAG ... ... .... 100's of lines I would like to rearrange the content of this file so it will be a... (1 Reply)
Discussion started by: Lucky Ali
1 Replies

3. Shell Programming and Scripting

Append text to end of line on all lines

Hi, I've spent some time researching for this but can't seem to find a solution. I have a file like this 1234|Test|20101111|18:00|19:00There will be multiple lines in the file with the same kind of format. For every line I need to make it this 1234|Test|20101111|18:00|19:00||create... (5 Replies)
Discussion started by: giles.cardew
5 Replies

4. Shell Programming and Scripting

Help required on joining one line above & below to the pattern matched string line.

Hi Experts, Help needed on joining one line above & below to the pattern matched string line. The input file, required output is mentioned below Input file ABCD DEFG5 42.0.1-63.38.31 KKKK iokl IP Connection Available ABCD DEFG5 42.0.1-63.38.31 ... (7 Replies)
Discussion started by: krao
7 Replies

5. Shell Programming and Scripting

how to append multiple lines to the last line of a file

Hello, This is what I am trying to achieve: file1 a b c d file2 e f g h (8 Replies)
Discussion started by: smarones
8 Replies

6. Shell Programming and Scripting

Joining multi-line output to a single line in a group

Hi, My Oracle query is returing below o/p ---------------------------------------------------------- Ins trnas value a lkp1 x a lkp1 y b lkp1 a b lkp2 x b lkp2 y ... (7 Replies)
Discussion started by: gvk25
7 Replies

7. UNIX for Dummies Questions & Answers

append following lines to 1st line, every 3 lines

I have output like this: USER_ID 12/31/69 19:00:00 12/31/69 19:00:00 USER_ID 12/31/69 19:00:00 12/31/69 19:00:00 USER_ID 12/31/69 19:00:00 12/31/69 19:00:00 USER_ID 12/31/69 19:00:00 12/31/69 19:00:00 ... where USER_ID is a unique user login followed by their login timestamp and... (6 Replies)
Discussion started by: MaindotC
6 Replies

8. Shell Programming and Scripting

joining multi-line file into single lines

Hi, I have a file like mentioned below..For each specific id starting with > I want to join the sequence in multiple lines to a single line..Is there a simple way in awk or sed to do this >ENST00000558922 cdna:KNOWN TCCAGGATCCAGCCTCCCGATCACCGCGCTAGTCCTCGCCCTGCCTGGGCTTCCCCAGAG... (2 Replies)
Discussion started by: Diya123
2 Replies

9. Shell Programming and Scripting

Append next line to previous lines when NF is less than 0

Hi All, This is very urgent, I've a data file with 1.7 millions rows in the file and the delimiter is cedilla and I need to format the data in such a way that if the NF in the next row is less than 1, it will append that value to previous line. Any help will be appricated. Thanks,... (17 Replies)
Discussion started by: cumeh1624
17 Replies

10. UNIX for Beginners Questions & Answers

Get an output of lines in pattern 1st line then 10th line then 11th line then 20th line and so on.

Input file: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 (6 Replies)
Discussion started by: Sagar Singh
6 Replies
IEEE1284_DATA(3)						     Functions							  IEEE1284_DATA(3)

NAME
ieee1284_read_data, ieee1284_write_data, ieee1284_data_dir, ieee1284_wait_data - control the data lines SYNOPSIS
#include <ieee1284.h> int ieee1284_read_data(struct parport *port); void ieee1284_write_data(struct parport *port, unsigned char dt); int ieee1284_data_dir(struct parport *port, int reverse); int ieee1284_wait_data(struct parport *port, unsigned char mask, unsigned char val, struct timeval *timeout); DESCRIPTION
These functions manipulate the data lines of the parallel port associated with port (which must have been claimed using ieee1284_claim(3)). The lines are represented by an 8-bit number (one line per bit) and a direction. The data lines are driven as a group; they may be all host-driven (forward direction) or not (reverse direction). When the peripheral is driving them the host must not. For ieee1284_data_dir the reverse parameter should be zero to turn the data line drivers on and non-zero to turn them off. Some port types may be unable to switch off the data line drivers. Setting the data lines may have side effects on some port types (for example, some Amiga ports pulse nStrobe). ieee1284_wait_data waits, up until the timeout, for the data bits specified in mask to have the corresponding values in val. RETURN VALUE
ieee1284_read_data returns the 8-bit number representing the data lines unless it is not possible to return such a value with this port type, in which case it returns an error code. Possible error codes: E1284_NOTAVAIL Bi-directional data lines are not available on this system. E1284_INVALIDPORT The port parameter is invalid (perhaps it has not been claimed, for instance). E1284_SYS There was an error at the operating system level, and errno has been set accordingly. E1284_TIMEDOUT The timeout has elapsed. Whereas ieee1284_read_data may return E1284_NOTAVAIL on its first invocation on the port, if it does not do so then it cannot until ieee1284_close is called for that port. AUTHOR
Tim Waugh <twaugh@redhat.com> Author. COPYRIGHT
Copyright (C) 2001-2003 Tim Waugh 09/18/2007 IEEE1284_DATA(3)
All times are GMT -4. The time now is 08:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy