Sponsored Content
Full Discussion: Vi editor, copy one column?
Top Forums Shell Programming and Scripting Vi editor, copy one column? Post 302380561 by Franklin52 on Tuesday 15th of December 2009 01:45:26 PM
Old 12-15-2009
Code:
%s/\(.*\) .*/& \1/

Explanation:

%s -> substitute in the whole file

The \( and \) pair are stored in a buffer. The first \( and \) pair will represent by \1, the second \( and \) is \2 and so on

\(.*\) -> The first pair is everything before the last space

.* -> (space followed by a dot and an asterix) the last space and everything thereafter

& -> represent the entire line here

& \1/ -> means substitute the line with entire line followed by a space and the first pair
 

5 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Copy/Paste in Vi editor

Dear All, I have a file containing 12 lines. First 3 lines have 9 values and the remaining 9 lines with no values. I was trying to copy and paste these 9 values of the first 3 lines into last 9 lines simultaneously as A=1.491331, B=1.539000 ..... but I don't know how to cope with this... (9 Replies)
Discussion started by: sullah
9 Replies

2. UNIX for Dummies Questions & Answers

Copy huge data into vi editor

Hi All, HP-UX dev4 B.11.11 U 9000/800 3251073457 I need to copy huge data from windows text file to vi editor. when I tried copy huge data, the format of data is not preserverd and appered to scatterd through the vi, something like give below. Please let me know, how can I correct this? ... (18 Replies)
Discussion started by: alok.behria
18 Replies

3. Shell Programming and Scripting

Copy from vi Editor ( unix ) to windows

How to copy the complete content from a file in vi Editor to windows ( notepad ). I can use " select " and paste it to windows but this is restricted to current page. Not allowing me to scroll down or up when selecting the content.:confused: (1 Reply)
Discussion started by: frintocf
1 Replies

4. UNIX for Dummies Questions & Answers

Copy/paste in vi editor

Hello guys, I am trying to copy a line in vi editor and paste it with below commands but paste command is not working and instead of paste action prints the p character!! I should also mention that the server is Solaris... 1) crontab -e 2) j to move down 3) yy to copy the line 4) o to... (4 Replies)
Discussion started by: Newman
4 Replies

5. UNIX for Beginners Questions & Answers

How to copy a column of multiple files and paste into new excel file (next to column)?

I have data of an excel files as given below, file1 org1_1 1 1 2.5 100 org1_2 1 2 5.5 98 org1_3 1 3 7.2 88 file2 org2_1 1 1 2.5 100 org2_2 1 2 5.5 56 org2_3 1 3 7.2 70 I have multiple excel files as above shown. I have to copy column 1, column 4 and paste into a new excel file as... (26 Replies)
Discussion started by: dineshkumarsrk
26 Replies
GLYPHS(5)							File Formats Manual							 GLYPHS(5)

NAME
glyphs - format of .glyphs files DESCRIPTION
Glyph files (``.glyph'' extension) are used to store commonly-used bit patterns (glyphs) for Magic. Right now, the bit patterns are used for two purposes in Magic. First, they specify patterns for programmable cursors: each cursor shape (e.g. the arrow used for the wiring tool) is read in as a glyph from a glyph file. Second, glyphs are used by the window manager to represent the icons displayed at the ends of scroll bars. Glyph file names normally have the extension .glyph. Glyph files are stored in ASCII format. Lines beginning with ``#'' are considered to be comments and are ignored. Blank lines are also ignored. The first non-comment line in a glyph file must have the syntax size nGlyphs width height The nGlyphs field must be a number giv- ing the total number of glyphs stored in the file. The width and height fields give the dimensions of each glyph in pixels. All glyphs in the same file must have the same size. The size line is followed by a description for each of the glyphs. Each glyph consists of height lines each containing 2xwidth characters. Each pair of characters corresponds to a bit position in the glyph, with the leftmost pair on the topmost line corresponding to the upper- left pixel in the glyph. The first character of each pair specifies the color to appear in that pixel. The color is represented as as a single character, which must be the short name of a display style in the current display style file. Some commonly-used characters are K for black, W for white, and . for the background color (when . is used in a cursor, it means that that pixel position is transparent: the underlying picture appears through the cursor). See ``Magic Maintainer's Manual #3: Display Styles, Color Maps, and Glyphs'' for more information. The second character of each pair is normally blank, except for one pixel per glyph which may contain a ``*'' in the second character. The ``*'' is used for programmable cursors to indicate the hot-spot: the pixel corresponding to the ``*'' is the one that the cursor is con- sidered to point to. For an example of a glyph file, see ~cad/lib/magic/sys/color.glyphs. SEE ALSO
magic(1), dstyle(5) 4th Berkeley Distribution GLYPHS(5)
All times are GMT -4. The time now is 07:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy