Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Need an awk command to delete a line Post 302770818 by Rahul619 on Monday 18th of February 2013 01:01:56 PM
Old 02-18-2013
Need an awk command to delete a line

Hi all,
As of now am using an awk command to check the number of columns in a file that has 10 lakh rows.
Is it possible to remove that particular line having an extra column and copy the remaining lines to a new file ?
YOUR HELP IS HIGHLY APPRECIATED. THANKS IN ADVANCE
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk : delete ^M at the end of the line

Hi all, I'm newbi in scripting. could someone tell how to delete the ^M at the end of the linie with an awk command. many thanks in advance. (2 Replies)
Discussion started by: liliput
2 Replies

2. UNIX for Dummies Questions & Answers

delete contents from command line

How might I delete the contents of a file from the command line? (not delete the file) (4 Replies)
Discussion started by: juanbro
4 Replies

3. Shell Programming and Scripting

how to delete line with awk

Hi I have a multi -line file which is sorted by the 1-st colomn in the following format: 400 0000 0001 1000 1010 0111 0000 1000 0000 402 1101 0000 1100 1010 0111 1000 1000 0000 403 1001 0000 1100 1010 0111 0000 1000 0000 495 1000 0000 1100 1010 0111 0000 1000 0000 500 0000 0001 1000 0010... (2 Replies)
Discussion started by: aoussenko
2 Replies

4. Shell Programming and Scripting

SED delete only first line command - Help need

Can any one help me how the sed delete only first line command (D) works. sed -f sedcmds File.txt In this how the sed delete only first line command (D) works to delete the blank lines appearing more than ones leaving only one blank and deleting others blanks. While doing step by step when... (2 Replies)
Discussion started by: gwgreen1
2 Replies

5. Shell Programming and Scripting

delete more than one line awk or perl

Hi all! How can a file be rid of three lines in sequence like the sample below: ... </s> <s> <w></w> </s> <s> ...to get: ... </s> <s> ... Note that the digits between square brackets may be more than one, comprising a comma, or a full-stop; and that the string between brackets... (1 Reply)
Discussion started by: mjomba
1 Replies

6. Shell Programming and Scripting

sed command to delete line

HI, Im using the below commmand to delete lines having "(" at the start of a line. sed -e '/^(/d' But i need a command to delete lines that has only "(" in it and no other strings. infile - asdf asdf ( asdf ( asd outfile (1 Reply)
Discussion started by: dvah
1 Replies

7. Shell Programming and Scripting

Delete specific line in awk

Hi, I'm totally new to awk, so thanks in advance for your help. I want to make a csv file out of a text file I've exported from a database I want to do two things: 1. Change pipes ("|") to commas (",") to make a text file into CSV 2. Remove the second line of the file, which is useless junk. ... (3 Replies)
Discussion started by: pip56789
3 Replies

8. Shell Programming and Scripting

sed command to delete everything after > on line

I have a large data file that I need to edit. There are lines like, > <IDNUMBER> (ST000002) > <SUPPLIER> (ST000002) > <IDNUMBER> (ST000004) > <SUPPLIER> (ST000004) and I need to delete everything after the >, excepting the end of line. > <IDNUMBER> > <SUPPLIER> > <IDNUMBER> > ... (4 Replies)
Discussion started by: LMHmedchem
4 Replies

9. UNIX for Dummies Questions & Answers

Using awk to delete a certain line

Ok I have a file that contains #num.txt 1 2 3 4 5 6 7 8 9 my script main.sh checks to see if the first two arguments exist in a seperate file and the third argument would be the value in the num.txt so when i execute $ main.sh name place 5 how would i go about deleteing the... (13 Replies)
Discussion started by: austing5
13 Replies

10. Shell Programming and Scripting

sed command to grep multiple pattern present in single line and delete that line

here is what i want to achieve.. i have a file with below contents cat fileName blah blah blah . .DROP this REJECT that . --sport 7800 -j REJECT --reject-with icmp-port-unreachable --dport 7800 -j REJECT --reject-with icmp-port-unreachable . . . more blah blah blah --dport 3306... (14 Replies)
Discussion started by: vivek d r
14 Replies
COLRM(1)						    BSD General Commands Manual 						  COLRM(1)

NAME
colrm -- remove columns from a file SYNOPSIS
colrm [start [stop]] DESCRIPTION
The colrm utility removes selected columns from the lines of a file. A column is defined as a single character in a line. Input is read from the standard input. Output is written to the standard output. If only the start column is specified, columns numbered less than the start column will be written. If both start and stop columns are spec- ified, columns numbered less than the start column or greater than the stop column will be written. Column numbering starts with one, not zero. Tab characters increment the column count to the next multiple of eight. Backspace characters decrement the column count by one. ENVIRONMENT
The LANG, LC_ALL and LC_CTYPE environment variables affect the execution of colrm as described in environ(7). EXIT STATUS
The colrm utility exits 0 on success, and >0 if an error occurs. SEE ALSO
awk(1), column(1), cut(1), paste(1) HISTORY
The colrm command appeared in 3.0BSD. BSD
August 4, 2004 BSD
All times are GMT -4. The time now is 12:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy