Sponsored Content
Top Forums Shell Programming and Scripting Search a file column wise and delete it Post 302416559 by agn on Tuesday 27th of April 2010 02:51:24 AM
Old 04-27-2010
Try,

Code:
$ awk -F ',' -v rnum=15 '$1 == rnum { next }1' studentrec.txt

Code:
$ rnum=23;sed  '/^'$rnum'/d' studentrec.txt


Last edited by agn; 04-27-2010 at 04:06 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Search for by column and delete line

I have a file with thousands of lines. I need to search for a specific value in a specific field and delete the lines that match. example. abcdXX1234567 abcdXY1234567 abcdXX1234567 abcdXX1234567 If there is an XY in position 5 and 6 then remove that line. Any suggestions would... (4 Replies)
Discussion started by: thudak
4 Replies

2. Shell Programming and Scripting

Column wise file parsing.

Shell script for the below operation : File "A" contains : SEQ++1' MOA+9:000,00:ABC' RFF+AIK:000000007' FII+PH+0170++AA' NAD+PL+++XXXXXXXXXXX XXXXXXX XX++XXX XXXX XXXX X.X. XXXXXXXXX+++NL' SEQ++2' MOA+9:389,47:ABC' RFF+AIK:02110300000008' FII+PH+0PSTBNL2A:25:5+BB'... (5 Replies)
Discussion started by: navojit dutta
5 Replies

3. Solaris

column wise substitution in a file

Hi, I have two files. Want to make an addition of the fifth column of from both the files and redirect it to a third file. Both files have same records except fifth field and same record should be inserted into new file having fifth field as addition of fifth fields of both files. for... (2 Replies)
Discussion started by: sanjay1979
2 Replies

4. Shell Programming and Scripting

Search a file column wise and delete it

i have a file which has a column that is unique i am intending to serach it and if it is there to remove the row. the file looks like ROLLNO,NAME ,SUB1,SUB2,SUB3,TOTAL,PERCENTAGE,RESULT 15 ,rig ,34 ,56 ,87 ,177 ,59 % ,PASS 23 ,wel ,45 ,76 ,56 ,177 ,59 % ... (0 Replies)
Discussion started by: gotam
0 Replies

5. Shell Programming and Scripting

read file line by line print column wise

I have a .csv file which is seperated with (;) inputfile --------- ZZZZ;AAAA;BBB;CCCC;DDD;EEE; YYYY;BBBB;CCC;DDDD;EEE;FFF; ... ... reading file line by line till end of file. while reading each line output format should be . i need to print only specific columns let say 5th... (2 Replies)
Discussion started by: rocking77
2 Replies

6. Shell Programming and Scripting

search column and delete row if greater than value

Hi, as the title states i need to find a way to search a column for values great than 1000, and if it is, then delete that row. An example 1 7.021 6.967 116.019 4 U 6.980E+07 0.000E+00 e 0 0 0 0 2 8.292 7.908 118.063 3 U 1.440E+07 0.000E+00 e 0 821 814 ... (3 Replies)
Discussion started by: olifu02
3 Replies

7. Shell Programming and Scripting

Adding content of two file in a single file column wise

Hi, I am trying to get the file in particular pattern using shell script. I have to add one column to some other file. For example consider two file as below. File1: name1 name2 name3 File2: Add1 age1 Add2 age2 Add3 age3 I want this two file in a single file format something like... (3 Replies)
Discussion started by: diehard
3 Replies

8. Red Hat

How to find a garbage entry in a column wise text file in Linux?

Suppose I have a file containing :- 1 Apple $50 2 Orange $30 3 Banana $10 4 Guava $25 5 Pine@apple $12 6 Strawberry $21 7 Grapes $12 In the 5th row, @ character inserted. I want through sort command or by any other way this row should either on top or bottom. By sort command garbage... (1 Reply)
Discussion started by: Dipankar Mitra
1 Replies

9. Shell Programming and Scripting

Search/grep on row and column wise

Hello, I have a comma seperate metadata as follows: CITY ,COUNTY,STATE,COUNTRY NEW_YORK,NYC ,NY ,USA NEWARK ,ESSEX ,NJ ,USA CHICAGO ,COOK ,IL ,USA SEATTLE ,MINER ,WA ,USA In my process, I get two key values ie CITY NAME (can be one of the... (7 Replies)
Discussion started by: calredd
7 Replies

10. Shell Programming and Scripting

Search string in multiple files and display column wise

I have 3 files. Each of those files have the same number of records, however certain records have different values. I would like to grep the field in ALL 3 files and display the output with only the differences in column wise and if possible line number File1 Name = Joe Age = 33... (3 Replies)
Discussion started by: sidnow
3 Replies
TCUTEST(1)							   Tokyo Cabinet							TCUTEST(1)

NAME
tcutest - test cases of the utility API DESCRIPTION
The command `tcutest' is a utility for facility test and performance test. This command is used in the following format. `rnum' specifies the number of iterations. `anum' specifies the initial number of elements of array. `bnum' specifies the number of buckets. tcutest xstr rnum Perform test of extensible string. tcutest list [-rd] rnum [anum] Perform test of array list. tcutest map [-rd] [-tr] [-rnd] [-dk|-dc|-dai|-dad|-dpr] rnum [bnum] Perform test of hash map. tcutest tree [-rd] [-tr] [-rnd] [-dk|-dc|-dai|-dad|-dpr] rnum Perform test of ordered tree. tcutest mdb [-rd] [-tr] [-rnd] [-dk|-dc|-dai|-dad|-dpr] rnum [bnum] Perform test of on-memory hash database. tcutest ndb [-rd] [-tr] [-rnd] [-dk|-dc|-dai|-dad|-dpr] rnum Perform test of on-memory tree database. tcutest misc rnum Perform test of miscellaneous routines. tcutest wicked rnum Perform updating operations of list and map selected at random. Options feature the following. -rd : perform the reading test also. -tr : perform the iterator test also. -rnd : select keys at random. -dk : use the function `tcxxxputkeep' instead of `tcxxxput'. -dc : use the function `tcxxxputcat' instead of `tcxxxput'. -dai : use the function `tcxxxaddint' instead of `tcxxxput'. -dad : use the function `tcxxxadddouble' instead of `tcxxxput'. -dpr : use the function `tcxxxputproc' instead of `tcxxxput'. This command returns 0 on success, another on failure. SEE ALSO
tcumttest(1), tcucodec(1), tcutil(3), tokyocabinet(3) Man Page 2011-02-12 TCUTEST(1)
All times are GMT -4. The time now is 09:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy