Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Remove a column using vi editor Post 302893524 by sp0 on Wednesday 19th of March 2014 03:18:18 PM
Old 03-19-2014
Remove a column using vi editor

How do i remove a column using vi editor

Assuming the file to be of format

Code:
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 msg to end
4969:  010 0xjill  spx -  11:29:51.498632789    18624  global service desk to the rescue

I want to be able to remove column 7 from the file using vi
AND
i would like to move column 7 to the beginning of the line using vi

Any suggestions.

I have searched in the forum, examples assume fixed size of the columns or using cut or awk.
Thank You.

Last edited by sp0; 03-19-2014 at 05:12 PM.. Reason: Change ICODE tags to CODE tags.
 

9 More Discussions You Might Find Interesting

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

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

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

4. Ubuntu

How to remove multiple spaces in between word? (VI EDITOR)?

What last line mode command allows me to remove extra spaces in between words in a text? (1 Reply)
Discussion started by: rabeel
1 Replies

5. Shell Programming and Scripting

need to remove duplicates based on key in first column and pattern in last column

Given a file such as this I need to remove the duplicates. 00060011 PAUL BOWSTEIN ad_waq3_921_20100826_010517.txt 00060011 PAUL BOWSTEIN ad_waq3_921_20100827_010528.txt 0624-01 RUT CORPORATION ad_sade3_10_20100827_010528.txt 0624-01 RUT CORPORATION ... (13 Replies)
Discussion started by: script_op2a
13 Replies

6. Shell Programming and Scripting

remove brackets and put it in a column and remove repeated entry

Hi all, I want to remove the remove bracket sign ( ) and put in the separate column I also want to remove the repeated entry like in first row in below input (PA156) is repeated ESR1 (PA156) leflunomide (PA450192) (PA156) leflunomide (PA450192) CHST3 (PA26503) docetaxel... (2 Replies)
Discussion started by: manigrover
2 Replies

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

8. UNIX for Dummies Questions & Answers

Swapping column in vi editor

is there any command in vi editor to turn this 986.000 4.026.000 775.328.625 9.319.003.000 986.000 4.036.000 775.328.625 9.318.803.000 986.000 4.046.000 775.328.625 9.318.603.000 986.000 4.056.000 775.328.625 9.318.403.000 become this... (5 Replies)
Discussion started by: muhnandap
5 Replies

9. Shell Programming and Scripting

Remove the values from a certain column without deleting the Column name in a .CSV file

(14 Replies)
Discussion started by: dhruuv369
14 Replies
funcolumnlookup(3)						SAORD Documentation						funcolumnlookup(3)

NAME
FunColumnLookup - lookup a Funtools column SYNOPSIS
#include <funtools.h> int FunColumnLookup(Fun fun, char *s, int which, char **name, int *type, int *mode, int *offset, int *n, int *width) DESCRIPTION
The FunColumnLookup() routine returns information about a named (or indexed) column. The first argument is the Fun handle associated with this set of columns. The second argument is the name of the column to look up. If the name argument is NULL, the argument that follows is the zero-based index into the column array of the column for which information should be returned. The next argument is a pointer to a char *, which will contain the name of the column. The arguments that follow are the addresses of int values into which the following information will be returned: o type: data type of column: o A: ASCII characters o B: unsigned 8-bit char o I: signed 16-bit int o U: unsigned 16-bit int (not standard FITS) o J: signed 32-bit int o V: unsigned 32-bit int (not standard FITS) o E: 32-bit float o D: 64-bit float o mode: bit flag status of column, including: o COL_ACTIVE 1 is column activated? o COL_IBUF 2 is column in the raw input data? o COL_PTR 4 is column a pointer to an array? o COL_READ 010 is read mode selected? o COL_WRITE 020 is write mode selected? o COL_REPLACEME 040 is this column being replaced by user data? o offset: byte offset in struct o n: number of elements (i.e. size of vector) in this column o width: size in bytes of this column If the named column exists, the routine returns a positive integer, otherwise zero is returned. (The positive integer is the index+1 into the column array where this column was located.) If NULL is passed as the return address of one (or more) of these values, no data is passed back for that information. For example: if( !FunColumnLookup(fun, "phas", 0, NULL NULL, NULL, NULL, &npha, NULL) ) gerror(stderr, "can't find phas column "); only returns information about the size of the phas vector. SEE ALSO
See funtools(7) for a list of Funtools help pages version 1.4.2 January 2, 2008 funcolumnlookup(3)
All times are GMT -4. The time now is 07:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy