Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Joining lines to single line in VI Post 95603 by blowtorch on Thursday 12th of January 2006 01:58:31 PM
Old 01-12-2006
You want to do this in vi right? Get to command mode in vi. Go to the line which should have the next line appended to it and then press shift-j (upper case j or J). This will append the next line at the end of the line that you currently are on.

eg. Your example will work as:
Code:
Line1[shift-j]     Line1 Line2[shift-j]     Line1 Line2 Line3
Line2          ->  Line3                  -> Line4                and so on... 
Line3               Line4 
Line4

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need output in different lines not in one single line

I am getting the coutput like this as show below in one single line, where as the command is executed is several lines and the output should also be requied in several lines, not in one single line. Anyone any idea? p4 opened -a | grep *locked* | awk '{ printf $8 }' >/tmp/aa $ cat... (1 Reply)
Discussion started by: csaha
1 Replies

2. Shell Programming and Scripting

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 ... (7 Replies)
Discussion started by: dwalley
7 Replies

3. Shell Programming and Scripting

joining 2 lines into single one

i have a script that joins 2 lines of a file into one line and again next 2 line into one line. if number of line is 4 then after joining it should be 2 lines in a file my file a1.txt has some of the below lines 1-GH32X, CC, AMR, Number of Intervals Not Inserted: 1 / 95 1-150KP1, CC,... (3 Replies)
Discussion started by: ali560045
3 Replies

4. Shell Programming and Scripting

Break lines up into single lines after each space in every line

It sounds a bit confusing but what I have is a text file like the example below (without the Line1, Line2, Line3 etc. of course) and I want to move every group of characters into a new line after each space. Example of text file; line1 .digg-widget-theme2 ul { background: rgb(0, 0, 0) none... (7 Replies)
Discussion started by: lewk
7 Replies

5. Shell Programming and Scripting

split single line into two line or three lines

Dear All, I want to split single line into two line or three lines wherever “|” separated values comes using Input line test,DEMTEMPUT20100404010012,,,,,,,,|0070086|0070087, output shoule be test,DEMTEMPUT20100404010012,,,,,,,,0070086, test,DEMTEMPUT20100404010012,,,,,,,,0070087, (14 Replies)
Discussion started by: arvindng
14 Replies

6. 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

7. Shell Programming and Scripting

Multiple lines in a single column to be merged as a single line for a record

Hi, I have a requirement with, No~Dt~Notes 1~2011/08/1~"aaa bbb ccc ddd eee fff ggg hhh" Single column alone got splitted into multiple lines. I require the output as No~Dt~Notes 1~2011/08/1~"aaa<>bbb<>ccc<>ddd<>eee<>fff<>ggg<>hhh" mean to say those new lines to be... (1 Reply)
Discussion started by: Bhuvaneswari
1 Replies

8. 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

9. 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

10. Shell Programming and Scripting

Write the lines in one single line

Hi, I need some iteration to do the following work. Sample: ANS|26-Jan-2012|26|MON|12536.1 ANS|26-Jan-2012|26|TUE|2536.1 ANS|26-Jan-2012|26|THUR|789.1 SED|26-Jan-2013|32|MON|258.1 SED|26-Jan-2013|32|TUE|369.1 SED|26-Jan-2013|32|THUR|2145.1 OUTPUT: ... (3 Replies)
Discussion started by: anshaa
3 Replies
mlib_VectorMulShift_U8_Mod(3MLIB)			    mediaLib Library Functions				 mlib_VectorMulShift_U8_Mod(3MLIB)

NAME
mlib_VectorMulShift_U8_Mod, mlib_VectorMulShift_U8_Sat, mlib_VectorMulShift_U8C_Mod, mlib_VectorMulShift_U8C_Sat, mlib_VectorMul- Shift_S8_Mod, mlib_VectorMulShift_S8_Sat, mlib_VectorMulShift_S8C_Mod, mlib_VectorMulShift_S8C_Sat, mlib_VectorMulShift_S16_Mod, mlib_Vec- torMulShift_S16_Sat, mlib_VectorMulShift_S16C_Mod, mlib_VectorMulShift_S16C_Sat, mlib_VectorMulShift_S32_Mod, mlib_VectorMulShift_S32_Sat, mlib_VectorMulShift_S32C_Mod, mlib_VectorMulShift_S32C_Sat - vector multiplication with shifting, in place SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_VectorMulShift_U8_Mod(mlib_u8 *xz, const mlib_u8 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_U8_Sat(mlib_u8 *xz, const mlib_u8 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_U8C_Mod(mlib_u8 *xz, const mlib_u8 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_U8C_Sat(mlib_u8 *xz, const mlib_u8 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S8_Mod(mlib_s8 *xz, const mlib_s8 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S8_Sat(mlib_s8 *xz, const mlib_s8 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S8C_Mod(mlib_s8 *xz, const mlib_s8 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S8C_Sat(mlib_s8 *xz, const mlib_s8 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S16_Mod(mlib_s16 *xz, const mlib_s16 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S16_Sat(mlib_s16 *xz, const mlib_s16 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S16C_Mod(mlib_s16 *xz, const mlib_s16 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S16C_Sat(mlib_s16 *xz, const mlib_s16 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S32_Mod(mlib_s32 *xz, const mlib_s32 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S32_Sat(mlib_s32 *xz, const mlib_s32 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S32C_Mod(mlib_s32 *xz, const mlib_s32 *y, mlib_s32 n, mlib_s32 shift); mlib_status mlib_VectorMulShift_S32C_Sat(mlib_s32 *xz, const mlib_s32 *y, mlib_s32 n, mlib_s32 shift); DESCRIPTION
Each of these functions performs an in-place multiplication of two vectors and shifts the result. For real data, the following equation is used: xz[i] = xz[i] * y[i] * 2**(-shift) where i = 0, 1, ..., (n - 1). For complex data, the following equation is used: tmp = xz[2*i] xz[2*i] = (tmp*y[2*i] - xz[2*i + 1]*y[2*i + 1]) * 2**(-shift) xz[2*i + 1] = (tmp*y[2*i + 1] + xz[2*i + 1]*y[2*i]) * 2**(-shift) where i = 0, 1, ..., (n - 1). PARAMETERS
Each of the functions takes the following arguments: xz Pointer to the first element of the first source and result vector. y Pointer to the first element of the second source vector. n Number of elements in each vector. shift Right shifting factor. The ranges of valid shift are: 1 <= shift <= 8 for U8, S8, U8C, S8C types 1 <= shift <= 16 for S16, S16C types 1 <= shift <= 31 for S32, S32C types RETURN VALUES
Each of the functions returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_VectorMulShift_U8_U8_Mod(3MLIB), attributes(5) SunOS 5.10 10 Nov 2004 mlib_VectorMulShift_U8_Mod(3MLIB)
All times are GMT -4. The time now is 09:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy