Sponsored Content
Full Discussion: removing a column from list
Top Forums Shell Programming and Scripting removing a column from list Post 29566 by jxh461 on Tuesday 8th of October 2002 05:59:48 PM
Old 10-08-2002
Question removing a column from list

What I am trying to do is figure out how to remove a column from a list in a file, or from the command line.

The opposite of cut -cX-Y file1

The file contains (result of who command)

jhabi0 pts/ta Oct 8 16:22
llemo0 pts/1 Oct 8 15:30
rgood0 pts/2 Oct 8 16:30
llemo0 pts/3 Oct 8 15:31
jlinc0 pts/tb Oct 8 16:31
rgood0 pts/4 Oct 8 16:10
jhabi0 pts/te Oct 8 09:17
cpacni pts/tf Oct 8 15:32
grenci pts/5 Oct 8 13:57
rhowa0 pts/th Oct 8 12:05
mmaha0 pts/tk Oct 8 15:40
grenci pts/7 Oct 8 13:58

and I would like to retrieve everything except (cut -c7-21)

pts/ta
pts/1
pts/2
pts/3
pts/tb
pts/tc
pts/td
.
.

Thanks in advance
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Removing Headers and a Column

I have a text file in unix with a layout like this Column 1 - 1-12 Column 2 - 13-39 Column 3 - 40-58 Column 4 - 59-85 Column 5 - 86-120 Columbn 6 - 121-131 The file also has a header on the first 6 lines of each page. Each page is 51 lines long. So I want to remove the header from each... (30 Replies)
Discussion started by: DerangedNick
30 Replies

2. UNIX for Dummies Questions & Answers

Removing comma after 3rd column

I have 10,000 lines to remove the commas after the 3rd column. Any help will be appreciated! Removing commas after the 3rd column Input aaaaa,bbbbb,cccccc,ddddddd aaaaa,bbbbb,cccccc aaaaa,bbbbb,cccccc,ddddddd,eeeeee aaaaa,bbbbb,cccccc,ddddddd,eeeeee,fffffff........(limit of comma is not... (13 Replies)
Discussion started by: buddyme
13 Replies

3. UNIX for Dummies Questions & Answers

Removing last ten characters from a column

I have a file that looks like this: hsa-miR-517b-4373244 0 4.116 hsa-miR-886-5p-4395304 1.173 1.95 hsa-miR-551b-4380945 1.62 1.722 hsa-miR-886-3p-4395305 1.479 3.074 hsa-miR-125a-3p-4395310 1.246 2.697 hsa-miR-874-4395379 1.985 1.721 I want it too look like this: ... (9 Replies)
Discussion started by: e3r1ck_ETT
9 Replies

4. Shell Programming and Scripting

removing square braces from a particular column

Hey Guys, I have a text which has data like this Taaaa AAA BBB SSSS $ yelpi Taaaa mmmm kly Tnnnw $ meta Baaaa Qriek Trieh Mbjsd $ kingsq .... I need to get an output like this MAX AAA TEST BBB RES SSSS YUYT test MED yelpi (0 Replies)
Discussion started by: naveen@
0 Replies

5. Shell Programming and Scripting

Removing lines from one list from another list.

Hello, I was wondering if there was an easy way to take lines from a single-column list, and remove them from a second single-column list. For example, I want to remove the contents of list 1 from list 2. How would I do this? Contents of list 1: server1a server2b server3c server4a... (2 Replies)
Discussion started by: LinuxRacr
2 Replies

6. Shell Programming and Scripting

Help in removing 1st column in file

Hi All, I have a input file CT;RE23;DR33;FT44 CT;RE24;DR22;FT55 Here i need to make and output file with below structure i need to remove the first column: RE23;DR33;FT44 RE24;DR22;FT55 How can i do this do i need to write a for loop for this Having 19 posts you should be... (12 Replies)
Discussion started by: kam786sim
12 Replies

7. Shell Programming and Scripting

Removing first column using awk script

I have this awk script. I have two different methods to remove the first column. However defining method = 1 in the BEGIN produces different results than when defining method = 1 later on instead. Any idea what it might be doing differently??? :rolleyes: BEGIN { Version = "V05" ... (4 Replies)
Discussion started by: kristinu
4 Replies

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

9. UNIX for Dummies Questions & Answers

Creating a two column list of date pairs form a single column list

Hi all, looking for some help here. I'm what you'd call a dirty programmer. my shell scripts might be ugly, but they (usually) function... Say I have a single column text file with a list of dates (yyyymmdd) that represent the elevation of a point on that date (I work with land subsidence, so... (2 Replies)
Discussion started by: jbrandt1979
2 Replies

10. Shell Programming and Scripting

How to use regex on particular column (Removing comma from particular column)?

Hi, I have pipe separated file which contains some data having comma(,) in it. I want to remove the comma(,) only from particular column without changing data in other columns. Below is the sample data file, I want to remove the comma(,) only from 5th column. $ cat file1 ABC | DEF, HIJ|... (6 Replies)
Discussion started by: Prathmesh
6 Replies
PTS_SLEEP(1)						       AFS Command Reference						      PTS_SLEEP(1)

NAME
pts_sleep - Pauses for a few seconds SYNOPSIS
pts sleep [-delay] <# of seconds> [-cell] <cell name> [-noauth] [-localauth] [-force] pts sl [-d] <# of seconds> [-c] <cell name> [-n] [-l] [-f] DESCRIPTION
The pts sleep pauses for a specified number of seconds. The command can be run from the command line or interactively, although from the command line it's essentially equivalent to the sleep command. It is intended for use in interactive mode to pause for a few seconds between batch commands to allow the Protection Server to catch up. CAUTIONS
Prior to OpenAFS 1.4.5 and OpenAFS 1.5.23, the pts sleep command was only available on Unix or Linux and when OpenAFS was compiled with the supergroups option (disabled by default). As of OpenAFS 1.4.5 and 1.5.23, it is always available. OPTIONS
Although they have no effect, pts sleep takes the following standard pts options: -cell <cell name> Names the cell in which to run the command. For more details, see pts(1). -force Enables the command to continue executing as far as possible when errors or other problems occur, rather than halting execution at the first error. -help Prints the online help for this command. All other valid options are ignored. -localauth Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. Do not combine this flag with the -cell or -noauth options. For more details, see pts(1). -noauth Assigns the unprivileged identity anonymous to the issuer. For more details, see pts(1). OUTPUT
This command produces no output. EXAMPLES
Here is an example of a pts interactive session: % pts interactive pts> sleep 5 pts> quit % SEE ALSO
pts(1), pts_interactive(1) COPYRIGHT
Copyright 2007 Jason Edgecombe <jason@rampaginggeek.com> This documentation is covered by the BSD License as written in the doc/LICENSE file. This man page was written by Jason Edgecombe for OpenAFS. OpenAFS 2014-04-08 PTS_SLEEP(1)
All times are GMT -4. The time now is 06:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy