Reject the record if the record in the next line does not begin with 2.
Hi,
I have a input file with the following entries:
The output should be:
The record that begins with 1 should have the next record to begin with 2 or 3 else reject that record.
The record that begins with 1 should have the next record to begin with 2 and if there are many records starting with 2, consider the first record only.
The rejected records should be captured in a file and the valid records in another file.
The requirement is this needs to be done in unix shell scripting. Please help me out in this.
Last edited by radoulov; 10-16-2011 at 10:34 AM..
Reason: Code tags!
Hi,
I am new to UNIX scripting and woiuld appreicate your help...
Input file contains only one (but long) record:
aaaaabbbbbcccccddddd.....
Desired file:
NEW RECORD #new record (hardcoded) added as first record - its length is irrelevant#
aaaaa
bbbbb
ccccc
ddddd
...
...
... (1 Reply)
Hi guys,
i have a big file with the following format.This includes header(H),detail(D) and trailer(T) information in the file.My problem is i have to search for the character "6h" at 14 th and 15 th position in all the records .if it is there i have to write all those records into a... (1 Reply)
I have i got a requirement like below.
I have input file which contains following fixed width records.
00000000000088500232007112007111
I need the full record and concatenated with ~ and characters from 1to 5 and concatenated with ~ and charactes from 10 to 15
The out put will be like... (1 Reply)
I am trying to see if there is a way in awk to test the next record before processing.
All I am trying to do is see if the next line equal something then turn a flag off.
Example:
Problem
Cron
IneedThis
KeyOnThis
somemoredata
somemoredata
Cron
somemoredata
somemoredata
IneedThis... (7 Replies)
Hi,
I have a input file with the following entries:
1one
2two
3three
1four
2five
3six
1seven
1eight
1nine
2ten
The output should be
1one
2two
3three
1four
2five
3six (2 Replies)
Hi! all
can any one tell me how to compare current record of column with next and previous record in awk without using array
my case is like this
input.txt
0 32
1 26
2 27
3 34
4 26
5 25
6 24
9 23
0 32
1 28
2 15
3 26
4 24 (7 Replies)
I have data coming in the below format for each record
<?xml version="1.0" encoding="UTF-8" standalone="no"?><test_sox xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><testdetials>....</test_sox>
<?xml version="1.0" encoding="UTF-8" standalone="no"?><test_sox... (8 Replies)
Hi,,
I have requirement that i need to get DISTINCT values from a table and if there are two records i need to update it to one record and then need to submit INSERT statements by using the updated value as a parameter. Here is the example follows..
SELECT DISTINCT ID FROM OFFER_GROUP WHERE... (1 Reply)
Discussion started by: Samah
1 Replies
LEARN ABOUT V7
tm
TM(4) Kernel Interfaces Manual TM(4)NAME
tm - TM-11/TU-10 magtape interface
DESCRIPTION
The files mt0, ..., mt7 refer to the DEC TU10/TM11 magtape. When closed it can be rewound or not, see below. If it was open for writing,
two end-of-files are written. If the tape is not to be rewound it is positioned with the head between the two tapemarks.
If the 0200 bit is on in the minor device number the tape is not rewound when closed.
A standard tape consists of a series of 512 byte records terminated by an end-of-file. To the extent possible, the system makes it possi-
ble, if inefficient, to treat the tape like any other file. Seeks have their usual meaning and it is possible to read or write a byte at a
time. Writing in very small units is inadvisable, however, because it tends to create monstrous record gaps.
The mt files discussed above are useful when it is desired to access the tape in a way compatible with ordinary files. When foreign tapes
are to be dealt with, and especially when long records are to be read or written, the `raw' interface is appropriate. The associated files
are named rmt0, ..., rmt7. Each read or write call reads or writes the next record on the tape. In the write case the record has the same
length as the buffer given. During a read, the record size is passed back as the number of bytes read, provided it is no greater than the
buffer size; if the record is long, an error is indicated. In raw tape I/O, the buffer must begin on a word boundary and the count must be
even. Seeks are ignored. A zero byte count is returned when a tape mark is read, but another read will fetch the first record of the new
tape file.
FILES
/dev/mt?, /dev/rmt?
SEE ALSO tp(1)BUGS
If any non-data error is encountered, it refuses to do anything more until closed. In raw I/O, there should be a way to perform forward
and backward record and file spacing and to write an EOF mark.
TM(4)