Sponsored Content
Top Forums Shell Programming and Scripting Parse a File ColumnWise & Delete the Rows Post 302494674 by Scrutinizer on Tuesday 8th of February 2011 03:53:07 AM
Old 02-08-2011
Since the file is sorted on column 4:
Code:
awk -F, 'p!=$4{if(s)print s;min=$2;p=$4}min>=$2{s=$0;min=$2}END{print s}' infile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Delete repeated rows from a file

Hi everybody: Could anybody tell me how I can delete repeated rows from a file?, this is, for exemple I have a file like this: 0.490 958.73 281.85 6.67985 0.002481 0.490 954.833 283.991 8.73019 0.002471 0.590 950.504 286.241 6.61451 0.002461 0.690 939.323 286.112 6.16451 0.00246 0.790... (8 Replies)
Discussion started by: tonet
8 Replies

2. Shell Programming and Scripting

How to delete particular rows from a file

Hi I have a file having 1000 rows. Now I would like to remove 10 rows from it. Plz give me the script. Eg: input file like 4 1 4500.0 1 5 1 1.0 30 6 1 1.0 4500 7 1 4.0 730 7 2 500000.0 730 8 1 785460.0 45 8 7 94255.0 30 9 1 31800.0 30 9 4 36000.0 30 10 1 15000.0 30... (5 Replies)
Discussion started by: suresh3566
5 Replies

3. Shell Programming and Scripting

how to delete duplicate rows in a file

I have a file content like below. "0000000","ABLNCYI","BOTH",1049,2058,"XYZ","5711002","","Y","","","","","","","","" "0000000","ABLNCYI","BOTH",1049,2058,"XYZ","5711002","","Y","","","","","","","","" "0000000","ABLNCYI","BOTH",1049,2058,"XYZ","5711002","","Y","","","","","","","",""... (5 Replies)
Discussion started by: vamshikrishnab
5 Replies

4. UNIX for Dummies Questions & Answers

Search for & edit rows & columns in data file and pipe

Dear unix gurus, I have a data file with header information about a subject and also 3 columns of n rows of data on various items he owns. The data file looks something like this: adam peter blah blah blah blah blah blah car 01 30 200 02 31 400 03 57 121 .. .. .. .. .. .. n y... (8 Replies)
Discussion started by: tintin72
8 Replies

5. Shell Programming and Scripting

delete rows in a file based on the rows of another file

I need to delete rows based on the number of lines in a different file, I have a piece of code with me working but when I merge with my C application, it doesnt work. sed '1,'\"`wc -l < /tmp/fileyyyy`\"'d' /tmp/fileA > /tmp/filexxxx Can anyone give me an alternate solution for the above (2 Replies)
Discussion started by: Muthuraj K
2 Replies

6. UNIX for Advanced & Expert Users

Delete rows from a file...!!

Say i have a file with X rows and Y columns....i see that in some of the rows,some columns are blank (no value set)...i wish to delete such rows....how can it be done? e.g 181766 100 2009-06-04 184443 2009-06-04 10962 151 2009-06-04 161 2009-06-04... (7 Replies)
Discussion started by: ak835
7 Replies

7. Shell Programming and Scripting

Delete rows from big file

Hi all, I have a big file (about 6 millions rows) and I have to delete same occurrences, stored in a small file (about 9000 rews). I have tried this: while read line do grep -v $line big_file > ok_file.tmp mv ok_file.tmp big_file done < small_file It works, but is very slow. How... (2 Replies)
Discussion started by: Tibbeche
2 Replies

8. Red Hat

Need Script to ZIP/SAVE & then DELETE Log file & DELETE ZIPS older than 12 months

ENVIROMENT Linux: Fedora Core release 1 (Yarrow) iPlanet: iPlanet-WebServer-Enterprise/6.0SP1 Log Path: /usr/iplanet/servers/https-company/logs I have iPlanet log rotation enabled rotating files on a daily basis. The rotated logs are NOT compressed & are taking up too much space. I... (7 Replies)
Discussion started by: zachs
7 Replies

9. Shell Programming and Scripting

Need Script to ZIP/SAVE & then DELETE Log file & send a mail conformation for any error

ENVIROMENT Linux: RHEL 6.4 Log Path: /usr/iplanet/servers/https-company/logs Log Format: user.log.03-15-2015 I have log4j log rotation enabled rotating files on a daily basis. The rotated logs are NOT compressed & are taking up too much space. I need a script that will run daily that... (1 Reply)
Discussion started by: admin_job_admin
1 Replies

10. Shell Programming and Scripting

SFTP Shell Script Get & Delete && Upload & Delete

Hi All, Do you have any sample script, - auto get file from SFTP remote server and delete file in remove server after downloaded. - only download specify filename - auto upload file from local to SFTP remote server and delete local folder file after uploaded - only upload specify filename ... (3 Replies)
Discussion started by: weesiong
3 Replies
PORTABASE(1)						      General Commands Manual						      PORTABASE(1)

NAME
portabase - an easy-to-use personal database application SYNOPSIS
portabase [ -h | --help | <file> ] portabase command [ -p password ] [ options ] <fromfile> <tofile> DESCRIPTION
PortaBase (portable database) is a personal database application that is available for many platforms, including Linux, Mac OS X, Windows, and Maemo. PortaBase's features include: - One data table per file - String, Integer, Decimal, Boolean, Note (multi-line text), Date, Time, Calculation, Sequence, Image, and Enum column types - Add, edit, and delete rows of data - Custom data views (subsets of the columns in any order) - Filter the displayed rows using sets of conditions - Sort the rows by any combination of columns, each in ascending or descending order - Optional page navigation buttons, with a custom number of rows per page - Add, delete, rearrange, and rename columns at any time - Specify default values for columns - View summary statistics for columns (total, average, min, max, etc.) - Import data from CSV, XML, and MobileDB files - Export data to CSV and XML files - Command-line format conversions (to and from XML, from MobileDB) - Data file encryption - Unicode support - Pick any available font to use throughout the application COMMANDS
PortaBase uses the following commands to indicate a command-line file conversion: fromxml Create a new PortaBase file from the input XML file. frommobiledb Create a new PortaBase file from the input MobileDB file. fromcsv Add rows to an existing PortaBase file from the input CSV file. toxml Create a new XML file from the input PortaBase file. tocsv Create a new CSV file from the input PortaBase file. If an encrypted PortaBase file is to be read or created, the following option can be used immediately after the command: -p <password> Open or create the encrypted PortaBase file using the given password The toxml and tocsv commands accept the following options: -v <view> Apply the named view before exporting. -s <sorting> Apply the named sorting before exporting. -f <filter> Apply the named filter before exporting. The fromcsv command supports one option: -e <encoding> Specifies the text encoding of the imported CSV file; options are UTF-8 (the default) and Latin-1. OPTIONS
PortaBase accepts the following options: -h, --help Display usage instructions. FILES
$HOME/.qt/portabaserc - user-specific settings. Stores information on font, checkbox editing, delete confirmations, etc. AUTHOR
This manual page was written by Jeremy Bowman <jmbowman@alum.mit.edu>, for the Debian GNU/Linux system (but may be used by others). April 16, 2010 PORTABASE(1)
All times are GMT -4. The time now is 11:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy