Sponsored Content
Full Discussion: Yank a column in vi
Top Forums UNIX for Dummies Questions & Answers Yank a column in vi Post 302070862 by jim mcnamara on Saturday 8th of April 2006 10:49:23 PM
Old 04-08-2006
Most versions of vi support the C-x commands.

Try man vi and look for open-rectangle, clear-rectangle, yank-rectangle,
delete-rectangle

If you have a big file and you want to lose,say all of column #5 in the entire file, try awk, it's a lot easier.
Code:
awk ' { print $1, $2, $3 , $5, $6}' oldfile>newfile

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

yank

This is supposed to be simple to do but I am having a hard time trying to yank 1 line (yy) but creating from it 100 lines. I can do yy then keep hitting . to repeat but it doesn't make sense. I may want to create 1000 lines from the one liner. yy then 99 p doesn't work.... Thanks. I was... (5 Replies)
Discussion started by: giannicello
5 Replies

2. UNIX for Dummies Questions & Answers

annoying vi yank word + delete all question

Hello when i try to yank word only that looks like this "$$foo$" when i stand with my curser marker on the first char ($) and do in vi : "yw" (yank word) its yanks me only the "$" char when i stand white my curser on "f" its yank's me only "foo" how can i yank all word no matter what... (4 Replies)
Discussion started by: umen
4 Replies

3. Shell Programming and Scripting

Changing one column of delimited file column to fixed width column

Hi, Iam new to unix. I have one input file . Input file : ID1~Name1~Place1 ID2~Name2~Place2 ID3~Name3~Place3 I need output such that only first column should change to fixed width column of 15 characters of length. Output File: ID1<<12 spaces>>Name1~Place1 ID2<<12... (5 Replies)
Discussion started by: manneni prakash
5 Replies

4. Shell Programming and Scripting

^M in yank but not in file in Vim

I am trying to visually select a section of text in vim and then substitute for it using the :%s/ sequence. First I visually select text. Then I yank using "ay. Then I type :%s/ followed by Control R and the register name, in this case a. This fills in the text I have visually selected into... (6 Replies)
Discussion started by: Enobarbus37
6 Replies

5. Shell Programming and Scripting

Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2

Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2 file 1 sample SNDK 80004C101 AT XLNX 983919101 BB NETL 64118B100 BS AMD 007903107 CC KLAC 482480100 DC TER 880770102 KATS ATHR 04743P108 KATS... (7 Replies)
Discussion started by: rydz00
7 Replies

6. UNIX for Dummies Questions & Answers

Yank versus control-insert formatting differences?

Hello! Graduate student thrown to the sharks of unix and fortran77 here. My basic question is this: what exactly is the difference between yank (ie "*yG for the whole file and "*p in a new file) and control-insert / shift-insert with respect to text formatting? One is vi and one is Windows,... (2 Replies)
Discussion started by: marshlight
2 Replies

7. Shell Programming and Scripting

Rename a header column by adding another column entry to the header column name URGENT!!

Hi All, I have a file example.csv which looks like this GrpID,TargetID,Signal,Avg_Num CSCH74_1_1,2007,61,256 CSCH74_1_1,212007,647,679 CSCH74_1_1,12007,3,32 CSCH74_1_1,207,299,777 I want the output as GrpID,TragetID,Signal-CSCH74_1_1,Avg_Num CSCH74_1_1,2007,61,256... (4 Replies)
Discussion started by: Vavad
4 Replies

8. UNIX for Dummies Questions & Answers

Rename a header column by adding another column entry to the header column name

Hi All, I have a file example.csv which looks like this GrpID,TargetID,Signal,Avg_Num CSCH74_1_1,2007,61,256 CSCH74_1_1,212007,647,679 CSCH74_1_1,12007,3,32 CSCH74_1_1,207,299,777 I want the output as GrpID,TragetID,Signal-CSCH74_1_1,Avg_Num CSCH74_1_1,2007,61,256... (1 Reply)
Discussion started by: Vavad
1 Replies

9. Shell Programming and Scripting

Difference of the same column when two other column matches and one column differs less than 1 hour

This is my input file : # cat list 20130430121600, cucm, location,76,2 20130430121600,cucm1,location1,76,4 20130430122000,cucm,location,80,8 20130430122000,cucm1,location1,90,8 20130430140000,cucm1,location1,87,11 20130430140000, cucm,location,67,9 This is the required output ... (1 Reply)
Discussion started by: Lakshmikumari
1 Replies

10. Shell Programming and Scripting

awk Print New Column For Every Two Lines and Match On Multiple Column Values to print another column

Hi, My input files is like this axis1 0 1 10 axis2 0 1 5 axis1 1 2 -4 axis2 2 3 -3 axis1 3 4 5 axis2 3 4 -1 axis1 4 5 -6 axis2 4 5 1 Now, these are my following tasks 1. Print a first column for every two rows that has the same value followed by a string. 2. Match on the... (3 Replies)
Discussion started by: jacobs.smith
3 Replies
GLRECT(3G)																GLRECT(3G)

NAME
glRectd, glRectf, glRecti, glRects, glRectdv, glRectfv, glRectiv, glRectsv - draw a rectangle C SPECIFICATION
void glRectd( GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2 ) void glRectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 ) void glRecti( GLint x1, GLint y1, GLint x2, GLint y2 ) void glRects( GLshort x1, GLshort y1, GLshort x2, GLshort y2 ) PARAMETERS
x1, y1 Specify one vertex of a rectangle. x2, y2 Specify the opposite vertex of the rectangle. C SPECIFICATION
void glRectdv( const GLdouble *v1, const GLdouble *v2 ) void glRectfv( const GLfloat *v1, const GLfloat *v2 ) void glRectiv( const GLint *v1, const GLint *v2 ) void glRectsv( const GLshort *v1, const GLshort *v2 ) PARAMETERS
v1 Specifies a pointer to one vertex of a rectangle. v2 Specifies a pointer to the opposite vertex of the rectangle. DESCRIPTION
glRect supports efficient specification of rectangles as two corner points. Each rectangle command takes four arguments, organized either as two consecutive pairs of (x,y) coordinates, or as two pointers to arrays, each containing an (x,y) pair. The resulting rectangle is defined in the z = 0 plane. glRect(x1, y1, x2, y2) is exactly equivalent to the following sequence: glBegin(GL_POLYGON); glVertex2(x1, y1); glVertex2(x2, y1); glVer- tex2(x2, y2); glVertex2(x1, y2); glEnd(); Note that if the second vertex is above and to the right of the first vertex, the rectangle is constructed with a counterclockwise winding. ERRORS
GL_INVALID_OPERATION is generated if glRect is executed between the execution of glBegin and the corresponding execution of glEnd. SEE ALSO
glBegin(3G), glVertex(3G) GLRECT(3G)
All times are GMT -4. The time now is 03:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy