Sponsored Content
Full Discussion: delete records from a file
Top Forums Shell Programming and Scripting delete records from a file Post 302135476 by Klashxx on Monday 10th of September 2007 04:52:59 AM
Old 09-10-2007
You can also use sed:

Code:
sed -e "/^[^\|]*\|abc\|/d" input_file.txt > output_file.txt

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Delete Duplicate records from a tilde delimited file

Hi All, I want to delete duplicate records from a tilde delimited file. Criteria is considering the first 2 fields, the combination of which has to be unique, below is a sample of records in the input file 1620000010338~2446694087~0~20061130220000~A00BCC1CT... (5 Replies)
Discussion started by: irshadm
5 Replies

2. UNIX for Dummies Questions & Answers

Use records from one file to delete records in another file

file_in_1: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 file_in_2: 9 10 11 12 21 22 23 24 1 2 3 4 17 18 19 20 file_out: (5 Replies)
Discussion started by: kenneth.mcbride
5 Replies

3. UNIX for Dummies Questions & Answers

How can you delete records in a file matching a pattern?

I am curious if the following can be done in a file in unix. Let's say I have a flat file with the following data AAA,12,2,,,, BBB,3,1,,,, CCC,,,,, DDD,2,,,,, SQQ,,,,, ASJ,,3,5 I only want to capture the data with values into a new file. If the data contains the pattern ,,,,, as in... (2 Replies)
Discussion started by: mode09
2 Replies

4. UNIX and Linux Applications

How to delete files with no records?

Hi, I have a file whose size is not zero but it has no records and another which has records. I want to delete all the files that have no records in it (even if size > 0). How do I do it? I have tried the below option #!/bin/ksh temp1 = $(wc -l < INVX102C.sf) if ; then echo "Data... (3 Replies)
Discussion started by: sangharsh
3 Replies

5. UNIX for Dummies Questions & Answers

Grep specific records from a file of records that are separated by an empty line

Hi everyone. I am a newbie to Linux stuff. I have this kind of problem which couldn't solve alone. I have a text file with records separated by empty lines like this: ID: 20 Name: X Age: 19 ID: 21 Name: Z ID: 22 Email: xxx@yahoo.com Name: Y Age: 19 I want to grep records that... (4 Replies)
Discussion started by: Atrisa
4 Replies

6. Shell Programming and Scripting

Need unix commands to delete records from one file if the same record present in another file...

Need unix commands to delete records from one file if the same record present in another file... just like join ... if the record present in both files.. delete from first file or delete the particular record and write the unmatched records to new file.. tried with grep and while... (6 Replies)
Discussion started by: msathees
6 Replies

7. UNIX for Dummies Questions & Answers

Delete records from a big file based on some condition

Hi, To load a big file in a table,I have a make sure that all rows in the file has same number of the columns . So in my file if I am getting any rows which have columns not equal to 6 , I need to delete it . Delimiter is space and columns are optionally enclosed by "". This can be ... (1 Reply)
Discussion started by: hemantraijain
1 Replies

8. Shell Programming and Scripting

Delete records within a file upon a condition

Hi Friends, I have the following file, cat input chr1 1000 2000 chr1 600 699 chr1 701 1000 chr1 600 1710 chr2 900 1800 Now, I would like to see the difference of Record1.Col2 - Record2.Col2 Record1.Col2 - Record2.Col3 Record1.Col3 - Record2.Col2 Record1.Col3 - Record2.Col3 ... (1 Reply)
Discussion started by: jacobs.smith
1 Replies

9. UNIX for Dummies Questions & Answers

Delete records based on a text file from a text file

Hi Folks, I am a novice and need to build a script in bash. I have 2 text files data.txt file is big file, column 2 is the we need to search and delete in the output. The filter file contains the rows to be deleted. Data.txt state city zone Alabama Huntsville 4 California SanDiego 3... (3 Replies)
Discussion started by: tech_frk
3 Replies

10. Shell Programming and Scripting

Delete the records in file based on lookup file.

Hi I have two files one.txt and two.txt one.txt 123 324 456 235 456 two txt abc one 000 123 abc abc one 000 456 abc abc one 000 122 abc abc one 000 111 abc My question here is, the records which are present in one.txt has to deleted in second file two.txt my output result... (2 Replies)
Discussion started by: Ganesh L
2 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
pilot-link(7) 0.12.5 Copyright 1996-2007 FSF pilot-addresses(1)
All times are GMT -4. The time now is 06:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy