The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How do I delete a data string from a .dat file in unix supergirl3954 UNIX for Dummies Questions & Answers 4 03-04-2008 07:56 AM
Script to search a bad record in a file then put the record in the bad file shilendrajadon Shell Programming and Scripting 2 12-28-2007 10:02 AM
Script to search a bad record in a file then put the record in the bad file shilendrajadon UNIX for Advanced & Expert Users 1 12-28-2007 10:00 AM
edit, and delete data from you file dorek High Level Programming 1 06-22-2006 10:09 PM
How to delete a record from a csv file Rajeev Agrawal UNIX for Dummies Questions & Answers 1 02-04-2006 01:43 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-06-2006
zhynxn zhynxn is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 3
how to delete record in file data with index in another file?

I want to deal with several data, i.e., data.*.txt with following structure
MSG|20010102|123 125 4562 409|SEND
MSG|20010102|120 230|SEND
MSG|20010102|120 204 5071|SEND
MSG|20010103|2 11 1098 9810|SEND
......

index file index.txt is
11
201
298
100
......

What I want to do is:
1) extract the record in index.txt
2) search it in data files $3, if this colomn contains the index number, then delete this record, else save without change

I have many questions:
1)Since each time I extract a record in index file, search it and delete records in data files, I have to save to original files for next index number. how can I save the file?
2) how to delete records using awk

i think it needs shell and awk scripts,
I try by myself, but i could not do any further.
while read record
do
awk ......
down < index.txt

thanks a lot.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:28 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0