Sponsored Content
Full Discussion: Swapping column in vi editor
Top Forums UNIX for Dummies Questions & Answers Swapping column in vi editor Post 302732677 by jlliagre on Monday 19th of November 2012 02:54:29 AM
Old 11-19-2012
and in case you find the pure vi solution too complex, you might use awk this way:
Code:
:%!awk '{t=$1;$1=$2;$2=t;print}'


Last edited by jlliagre; 11-19-2012 at 04:16 AM..
 

10 More Discussions You Might Find Interesting

1. SuSE

Swapping

Hello! Why does my SuSE GNU/Linux machine swap? I have a Gig of ram, currently 14MBs of free RAM, 724MB - buffers and caches... That is 685MB of cached RAM, then kernel really should'nt have to swap, It should release cached memory in my thinkin... It has only swaped 3MB's but still,... (3 Replies)
Discussion started by: Esaia
3 Replies

2. UNIX for Dummies Questions & Answers

Pasting text in VI editor from a different editor

Hi, I knw its a silly question, but am a newbie to 'vi' editor. I'm forced to use this, hence kindly help me with this question. How can i paste a chunk 'copied from' a different editor(gedit) in 'vi editor'? As i see, p & P options does work only within 'vi'. (10 Replies)
Discussion started by: harishmitty
10 Replies

3. Shell Programming and Scripting

set EDITOR=vi -> default editor not setting for cron tab

Hi All, I am running a script , working very fine on cmd prompt. The problem is that when I open do crontab -e even after setting editor to vi by set EDITOR=vi it does not open a vi editor , rather it do as below..... ///////////////////////////////////////////////////// $ set... (6 Replies)
Discussion started by: aarora_98
6 Replies

4. Shell Programming and Scripting

VI editor,column postion

In VI editor ctrl + g is used indicate the line number on which the cursor is placed...similarly is there a way to determine the column number of the cursor position..? (1 Reply)
Discussion started by: vijay_0209
1 Replies

5. UNIX for Dummies Questions & Answers

Swapping in VI editor

Hi, I am attempting to replace several similar words with another word in vi. Here is what I have written for the script: 3dTcat -prefix SuperBrik_4WAY_HRF ../JULY10_2007A/results2TENT/stats.JULY10_2007A+tlrc ../JULY10_2007G/results2TENT/stats.JULY10_2007G+tlrc... (1 Reply)
Discussion started by: Jahn
1 Replies

6. Shell Programming and Scripting

Vi editor, copy one column?

This is an vi editor question. I do not know is this a right place to ask this question or not? I have a file with the following contents, 10 11 20 21 30 31 I want to copy first column that is 10,20,30 after second column, so that output will look like the following, 10 11 10 20 21 20... (3 Replies)
Discussion started by: MeetP
3 Replies

7. Solaris

How to set VI editor column size on Solaris?

I am setting the size using "stty columns 120" . But I still get the prompt saying "terminal too wide " when I am in vi. is there any time limit for this setting? how to set the column size to 120 permanently? Thanks in advance, Devi (4 Replies)
Discussion started by: pvkdevi
4 Replies

8. UNIX for Dummies Questions & Answers

Delete a specific column using vi editor?

Hello Experts, I'm a newbie so please excuse any wrong doings. I have a file that looks like this. abc def ghi jkl mno def abc ghi mno jkl ghi def mno jkl abc I would like the file to look like this abc def ghi jklmno def abc ghi mnojkl ghi def mno jklabc in other... (3 Replies)
Discussion started by: fnebiolo
3 Replies

9. UNIX for Dummies Questions & Answers

Removing 2nd Column in Vi Editor

I have text like this M83-306 132 797 M83-312 145 685 M83-315 321 479 M83-319 654 193 M83-350 556 1184 M83-303 222 199 and I want to make it like this M83-306 797 M83-312 685 M83-315 ... (9 Replies)
Discussion started by: muhnandap
9 Replies

10. UNIX for Dummies Questions & Answers

Remove a column using vi editor

How do i remove a column using vi editor Assuming the file to be of format 1: 010 0xad45 sp1 - 11:29:51.498583949 500249144 Event1 rst bcfe jhv rgc 456: 010 0xadb sp2 - 11:29:51.498600605 4464 Event0abcrd adabc aasd 45: 010 0x10 sp0 - 11:29:51.498614165 13560 Back adxca... (6 Replies)
Discussion started by: sp0
6 Replies
CFDISK(8)							 GNU cfdisk Manual							 CFDISK(8)

NAME
GNU cfdisk - a curses-based partition table manipulation program SYNOPSIS
cfdisk [options] [device] DESCRIPTION
cfdisk is a disk partition manipulation program, which allows you to create, destroy, resize, move and copy partitions on a hard drive using a simple menu-driven interface. It is useful for organising the disk space on a new drive, reorganising an old drive, creating space for new operating systems, and copying data to new hard disks. For a list of the supported partition types, see the --list-partition-types option below. OPTIONS
-h, --help displays a help message. -v, --version displays the program's version. -a, --arrow-cursor use an arrow cursor, instead of reverse video highlighting, in case your terminal doesn't support it. -z, --new-table create a new partition table on the disk. This is useful if you want to change the partition table type or want to repartition you entire drive. Note that this does not delete the old table on the disk until you commit the changes. -u, --units=UNIT sets the default display units to UNIT. A list of possible units is given below. -t, --list-partition-types displays a list of supported partition types and features. UNITS
You can choose in what unit cfdisk should display quantities like partition sizes. You can choose from sectors, percents, bytes, kilobytes, etc. Note that one kilobyte is equal to 1,000 bytes, as this is consistent with the SI prefixes and is used by hard disk manufacturers. If you prefer to see the sizes in units with binary prefixes, you should instead select one kilo binary byte (kibibyte), which is equal to 1,024 bytes. Whatever display unit you have chosen, you can always enter the quantities in the unit of your choice, for example 1000000B or 1000kB. compact display each size in the most suitable unit from B, kB, MB, GB and TB. B one byte kB one kilobyte (1,000 bytes) MB one megabyte (1,000,000 bytes) GB one gigabyte (1,000,000,000 bytes) TB one terabyte (1,000,000,000,000 bytes) KiB one kilo binary byte (1,024 bytes) MiB one mega binary byte (1,048,576 bytes) GiB one giga binary byte (1,073,741,824 bytes) TiB one tera binary byte (1,099,511,627,776 bytes) s one sector. It depends on the sector size of the disk. You can use it if you want to see or choose the exact size in sectors. % one percent from the size of the disk cyl one cylinder. It depends on the cylinder size. chs use CHS display units. BUGS
There are no known bugs. We are in early stages for development, so be careful. SEE ALSO
fdisk(8), mkfs(8), parted(8) The cfdisk program is fully documented in the info(1) format GNU cfdisk User Manual manual. fdisk 16 June, 2006 CFDISK(8)
All times are GMT -4. The time now is 01:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy