Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Filtering records of a csv file based on a value of a column Post 303030363 by RudiC on Friday 8th of February 2019 10:42:14 AM
Old 02-08-2019
Or even



Code:
awk -F, '$4 == "Active"' file


EDIT: Added missing " ; thanks to vgersh99!

Last edited by RudiC; 02-08-2019 at 12:35 PM..
This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Filtering records of a file based on a value of a column

Hi all, I would like to extract records of a file based on a condition. The file contains 47 fields, and I would like to extract only those records that match a certain value in one of the columns, e.g. COL1 COL2 COL3 ............... COL47 1 XX 45 ... (4 Replies)
Discussion started by: risk_sly
4 Replies

2. Shell Programming and Scripting

filtering records based on numeric field value in 8th position

I have a ";" delimited file.Whcih conatins a number fileds of length 4 charcters in 8th position But there is a alphanumeric charcters like : space, ";" , "," , "/" , "23-1" , "23 1" , "aqjhdj" , "jun-23" , "APR-04" , "4:00AM" , "-234" , "56784 ", "." , "+" "_" , "&" , "*" , "^" , "%" , "!"... (2 Replies)
Discussion started by: indusri
2 Replies

3. Shell Programming and Scripting

Removing duplicate records in a file based on single column

Hi, I want to remove duplicate records including the first line based on column1. For example inputfile(filer.txt): ------------- 1,3000,5000 1,4000,6000 2,4000,600 2,5000,700 3,60000,4000 4,7000,7777 5,999,8888 expected output: ---------------- 3,60000,4000 4,7000,7777... (5 Replies)
Discussion started by: G.K.K
5 Replies

4. Shell Programming and Scripting

Nawk script to compare records of a file based on a particular column.

Hi Gurus, I am struggling with nawk command where i am processing a file based on columns. Here is the sample data file. UM113570248|24-AUG-11|4|man1|RR211 Alert: Master Process failure |24-AUG-11 UM113570624|24-AUG-11|4|man1| Alert: Pattern 'E_DCLeDAOException' found |24-AUG-11... (7 Replies)
Discussion started by: usha rao
7 Replies

5. UNIX for Dummies Questions & Answers

Filtering records from 1 file based on some manipulation doen on second file

Hi, I am looking for an awk script which should help me to meet the following requirement: File1 has records in following format INF: FAILEd RECORD AB1234 INF: FAILEd RECORD PQ1145 INF: FAILEd RECORD AB3215 INF: FAILEd RECORD AB6114 ............................ (2 Replies)
Discussion started by: mintu41
2 Replies

6. Shell Programming and Scripting

Filtering lines for column elements based on corresponding counts in another column

Hi, I have a file like this ACC 2 2 21 aaa AC 443 3 22 aaa GCT 76 1 33 xxx TCG 34 2 33 aaa ACGT 33 1 22 ggg TTC 99 3 44 wee CCA 33 2 33 ggg AAC 1 3 55 ddd TTG 10 1 22 ddd TTGC 98 3 22 ddd GCT 23 1 21 sds GTC 23 4 32 sds ACGT 32 2 33 vvv CGT 11 2 33 eee CCC 87 2 44... (1 Reply)
Discussion started by: polsum
1 Replies

7. Shell Programming and Scripting

Filtering first file columns based on second file column

Hi friends, I have one file like below. (.csv type) SNo,data1,data2 1,1,2 2,2,3 3,3,2 and another file like below. Exclude data1 where Exclude should be treated as column name in file2. I want the output shown below. SNo,data2 1,2 2,3 3,2 Where my data1 column got removed from... (2 Replies)
Discussion started by: ks_reddy
2 Replies

8. Shell Programming and Scripting

Pick the column value based on another column from .csv file

My scenario is that I need to pick value from third column based on fourth column value, if fourth column value is 1 then first value of third column.Third column (2|3|4|6|1) values are cancatenated. Main imp point, in my .csv file, third column is having price value with comma (1,20,300), it has... (2 Replies)
Discussion started by: Ganesh L
2 Replies

9. Shell Programming and Scripting

Get maximum per column from CSV file, based on date column

Hello everyone, I am using ksh on Solaris 10 and I'm gathering data in a CSV file that looks like this: 20170628-23:25:01,1,0,0,1,1,1,1,55,55,1 20170628-23:30:01,1,0,0,1,1,1,1,56,56,1 20170628-23:35:00,1,0,0,1,1,2,1,57,57,2 20170628-23:40:00,1,0,0,1,1,1,1,58,58,2... (6 Replies)
Discussion started by: ejianu
6 Replies

10. Shell Programming and Scripting

Filter duplicate records from csv file with condition on one column

I have csv file with 30, 40 columns Pasting just three column for problem description I want to filter record if column 1 matches CN or DN then, check for values in column 2 if column contain 1235, 1235 then in column 3 values must be sequence of 2345, 2345 and if column 2 contains 6789, 6789... (5 Replies)
Discussion started by: as7951
5 Replies
pilot-addresses(1)						    PILOT-LINK							pilot-addresses(1)

NAME
pilot-addresses - Read and write address book databases to and from a Palm handheld. SECTION
pilot-link: Userland conduits LOCATION
./src SYNOPSIS
pilot-addresses [-p|--port <port>] [--version] [-?|--help] [--usage] [-q|--quiet] [--delete-all] [-t|--delimiter INT] [-d|--delete-cate- gory category ] [-c|--category category] [-a|--augment] [-r|--read file] [-w|--write file ] [-C|--human-readable] DESCRIPTION
pilot-addresses allows the user to read all entries from a Palm handheld such as those made by Palm, Handspring, Handera, TRGPro, Sony or other Palm handheld in the Palm Address Book application, write new entries into the database, and delete a category or delete all entries in the database. COMMANDS
Provide exactly one of --read or --write. -r, --read=<file> Reads records from <file> and install them to the Palm Address Book application. (Use the -w <file> option to get a sample "template file" for input records to see how the fields are laid out). -w, --write=file Reads all address book records from the Palm Address Book application and writes them into file OPTIONS
pilot-addresses options -a, --augment Augments fields in address book records with additional information. The augmented information is placed before and separated from the field with a semi-colon, (;). Augmented information can include any of the following below. category # Placed in front of each record or.. Placed in front of each phone number field: ["Work"|"Home"|"Fax"|"Other"|"E-mail"|"Main"|"Pager"|"Mobile"] Empty fields are not augmented. -c, --category=category Install records to category category by default. Normally pilot-addresses uses the Unfiled category by default. This option is overridden by the category specified in the record with the -a option. -d, --delete-category Delete all records in the specified category category before installing new records. Note that the long name of this option has changed since 0.11.8 -D, --delete-all Delete all address book records in all categories. Obviously, be very careful with this one. Note that the long name of this option has changed since 0.11.8 -t, --delimiter INT Include category in each record, use the delimiter specified to separate all fields of a record. Delimiters are specified as follows: 3=tab, 2=;, 1=,. This overrides the default delimiter of comma between fields and semi-colon between a field's augmented information. (Please note that this may generate confusing results when used with the -a option.) Note that the long name of this option has changed since 0.11.8 -T, --titles Obsolete. This option has been removed since 0.11.8 -C|--human-readable Write generic human-readable output instead of CSV. Conduit Options -p, --port <port> Use device file <port> to communicate with the Palm handheld. If this is not specified, pilot-addresses will look for the $PILOTPORT environment variable. If neither are found or supplied, pilot-addresses will print the usage information. -q, --quiet Suppress 'Hit HotSync button' message -v, --version Display version of pilot-addresses and exit without connecting. Help Options -h, --help Display the help synopsis for pilot-addresses and exit without connecting. --usage Display a brief usage message and exit without connecting. USAGE
The program will connect to the Palm handheld, and perform the requested read or write operation specified by the user. EXAMPLES
To write all address records in a Palm to the file addrbook.csv: pilot-addresses -w addrbook.csv or pilot-addresses -p /dev/pilot -w addrbook.csv To read the address book records in the file addrbook.csv and install them onto the Palm: pilot-addresses -r addrbook.csv To read the address book records in the file addrbook.csv and place them into the Palm address book database category Special after first deleting all current records in the Special category on the palm: pilot-addresses -c Special -d Special -r addrbook.csv AUTHOR
pilot-addresses originally written by Kenneth Albanowski, this manual page was originally written by Robert Wittig <bob.wittig@gt.org> and later updated by David A. Desrosiers <hacker@gnu-designs.com> and Neil Williams <linux@codehelp.co.uk>. REPORTING BUGS
We have an online bug tracker. Using this is the only way to ensure that your bugs are recorded and that we can track them until they are resolved or closed. Reporting bugs via email, while easy, is not very useful in terms of accountability. Please point your browser to http://bugs.pilot-link.org: http://bugs.pilot-link.org and report your bugs and issues there. COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. SEE ALSO
addresses(1) pilot-link(7) 0.12.5 Copyright 1996-2007 FSF pilot-addresses(1)
All times are GMT -4. The time now is 06:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy