Sponsored Content
Top Forums Shell Programming and Scripting Delete records in reverse order Post 302834047 by krupasindhu18 on Thursday 18th of July 2013 09:37:44 AM
Old 07-18-2013
Delete records in reverse order

Hi all,
i have dynamic file 'xyz.txt', records always look likes below format ...
Code:
0000021 RET     31-MAR-1984     FAP
0000021 DTA     14-JAN-2003     CNV
0000021 DTA     25-MAR-2012     DTA
0000021 DTA     26-MAR-2012     DTA
#################################################
0000021 DTA     14-JAN-2003     CNV
0000021 DTA     25-MAR-2012     DTA
0000021 DTA     26-MAR-2012     DTA
################################################
0000021 RET     31-MAR-1984     FAP
0000021 DTA     14-JAN-2003     CNV
0000021 DTA     25-MAR-2012     DTA
0000021 DTA     26-MAR-2012     DTA
################################################
0000021 RET     31-MAR-1984     FAP
0000021 DTA     14-JAN-2003     CNV
0000021 DTA     25-MAR-2012     DTA
0000021 DTA     26-MAR-2012     DTA
################################################
0000021 DTA     14-JAN-2003     CNV
0000021 RET     31-MAR-1984     FAP
0000021 DTA     26-MAR-2012     DTA

I want to cut or delete (any one would be ok ) records from starting with ##### towords begin (reverse)
e.g. in my case
Code:
0000021 RET     31-MAR-1984     FAP
0000021 DTA     14-JAN-2003     CNV
0000021 DTA     25-MAR-2012     DTA
0000021 DTA     26-MAR-2012     DTA
#################################################

above should be my expected result.

same for 2nd
Code:
0000021 DTA     14-JAN-2003     CNV
0000021 DTA     25-MAR-2012     DTA
0000021 DTA     26-MAR-2012     DTA
################################################

same for 3rd ..
Code:
0000021 RET     31-MAR-1984     FAP
0000021 DTA     14-JAN-2003     CNV
0000021 DTA     25-MAR-2012     DTA
0000021 DTA     26-MAR-2012     DTA
################################################

please help me .
advance Thanks,

Thanks,
Krupa

Last edited by Scott; 07-18-2013 at 11:28 AM.. Reason: Code tags
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

using sed and regex to reverse order???

so i have been trying to learn how to manipulate text on my own and have gotten stumped... let's say i have a text file that says (highly simplified): people ordinary How would swap the order of the words.. I know i need to use sed and some kind of back reference but cannot make it... (2 Replies)
Discussion started by: urtherhoda
2 Replies

2. Shell Programming and Scripting

sort a file in reverse order

I a file with log entries... I want to sort it so that the last line in the file is first and the first line is last.. eg. Sample file 1 h a f 8 6 After sort should look like 6 8 f a h 1 (11 Replies)
Discussion started by: frustrated1
11 Replies

3. UNIX for Dummies Questions & Answers

sort -reverse order

I need to sort the particular column only in reverse order how i can give it.. if i give the -r option the whole file is getting sorted in reverse order. 1st 2nd col 3rd C col 4th col 5th col ------------------------------------------- C... (7 Replies)
Discussion started by: sivakumar.rj
7 Replies

4. Shell Programming and Scripting

How to get fields in reverse order?

i am having lines like below seperated by "|" (pipe) abc|xyz 123|567 i have to get the above in reverse order xyz|abc 567|123 Pls help (5 Replies)
Discussion started by: suryanarayana
5 Replies

5. UNIX for Dummies Questions & Answers

How to print arguments in reverse order?

Hey all, How do I make a script print its arguments in reverse order? Thanks (5 Replies)
Discussion started by: unclepickle1
5 Replies

6. UNIX for Dummies Questions & Answers

printing fields in reverse order

command/script(apart from awk) to print the fields in reverse order that is last field has to come first and so on and first field has to go last Input store-id date sale ............. ............. ... (3 Replies)
Discussion started by: tsurendra
3 Replies

7. Shell Programming and Scripting

print in reverse order

Hi, I want to print the item in reverse order such that the output would look like 00 50 50 23 40 22 02 96 Below is the input: 00 05 05 32 04 22 20 69 Video tutorial on how to use code tags in The UNIX and Linux Forums. (5 Replies)
Discussion started by: reignangel2003
5 Replies

8. Shell Programming and Scripting

Sorting strings in reverse order

Hello, I have a large database of words and would like them sorted in reverse order i.e. from the end up. An example will make this clear: I have tried to write a program in Perl which basically takes the string from the end and tries to sort from that end but it does not seem... (5 Replies)
Discussion started by: gimley
5 Replies

9. UNIX for Beginners Questions & Answers

Issues with sorting in reverse order

I have a unix script that outputs a summary file to the mac desktop. The file is called summary.txt I am trying to configure such so that the summary.txt file lists the content contained within such in reverse sort order. I have used sort -r but it does not seem to work. I would be... (8 Replies)
Discussion started by: Braveheart
8 Replies
INTERFACE-ORDER(5)						    resolvconf							INTERFACE-ORDER(5)

NAME
interface-order - resolvconf configuration file DESCRIPTION
The file /etc/resolvconf/interface-order is used to control the order in which resolvconf nameserver information records are processed by those resolvconf update scripts that consult this file. (The name of the file is apt because a resolvconf nameserver information record is named after the interface with which it is associated.) The file contains a sequence of shell glob patterns, one per line. The position of a record in the order is the point at which its name first matches a pattern. Patterns may not contain whitespace, slashes or initial dots or tildes. Blank lines and lines beginning with a '#' are ignored. Resolvconf update scripts in /etc/resolvconf/update.d/ that consult this file include the current default versions of dnsmasq, pdnsd and libc. (Actually they don't read the file directly; they call the utility program /lib/resolvconf/list-records which lists records in the specified order and omits the names of empty records.) EXAMPLE
# /etc/resolvconf/interface-order # Use nameservers on the loopback interface first. lo* # Next use records for Ethernet interfaces eth* # Next use records for Wi-Fi interfaces wlan* # Next use records for PPP interfaces ppp* # Last use other interfaces * AUTHOR
Resolvconf was written by Thomas Hood <jdthood@gmail.com>. COPYRIGHT
Copyright (C) 2004, 2011 Thomas Hood This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. SEE ALSO
resolvconf(8) resolvconf 18 May 2011 INTERFACE-ORDER(5)
All times are GMT -4. The time now is 03:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy