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)
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT DEBIAN
xml::sax::pipeline
XML::SAX::Pipeline(3pm) User Contributed Perl Documentation XML::SAX::Pipeline(3pm)NAME
XML::SAX::Pipeline - Manage a linear pipeline of SAX processors
SYNOPSIS
use XML::SAX::Machines qw( Pipeline ); ## Most common way
use XML::Fitler::Foo;
my $m = Pipeline(
XML::Filter::Foo->new, ## Create it manually
"XML::Filter::Bar", ## Or let Pipeline load & create it
"XML::Filter::Baz",
{
## Normal options
Handler => $h,
}
);
## To choose the default parser automatically if XML::Filter::Foo
## does not implement a parse_file method, just pretend the Pipeline
## is a parser:
$m->parse_file( "blah" );
## To feed the pipeline from an upstream processor, treat it like
## any other SAX filter:
my $p = Some::SAX::Generator->new( Handler => $m );
## To read a file or the output from a subprocess:
my $m = Pipeline( "<infile.txt" );
my $m = Pipeline( "spew_xml |" );
## To send output to a file handle, file, or process:
my $m = Pipeline( ..., *STDOUT );
my $m = Pipeline( ..., ">outfile.txt" );
my $m = Pipeline( ..., "| xmllint --format -" );
DESCRIPTION
An XML::SAX::Pipeline is a linear sequence SAX processors. Events passed to the pipeline are received by the "Intake" end of the pipeline
and the last filter to process events in the pipeline passes the events out the "Exhaust" to the filter set as the pipeline's handler:
+-----------------------------------------------------------+
| An XML:SAX::Pipeline |
| Intake |
| +---------+ +---------+ +---------+ Exhaust |
--+-->| Stage_0 |--->| Stage_1 |-->...-->| Stage_N |----------+----->
| +---------+ +---------+ +---------+ |
+-----------------------------------------------------------+
As with all SAX machines, a pipeline can also create an ad hoc parser (using XML::SAX::ParserFactory) if you ask it to parse something and
the first SAX processer in the pipeline can't handle a parse request:
+-------------------------------------------------------+
| An XML:SAX::Pipeline |
| Intake |
| +--------+ +---------+ +---------+ Exhaust |
| | Parser |-->| Stage_0 |-->...-->| Stage_N |----------+----->
| +--------+ +---------+ +---------+ |
+-------------------------------------------------------+
or if you specify an input file like so:
my $m = Pipeline(qw(
<input_file.xml
XML::Filter::Bar
XML::Filter::Baz
));
Pipelines (and machines) can also create ad hoc XML::SAX::Writer instances when you specify an output file handle (as shown in the
SYNOPSIS) or an output file:
my $m = Pipeline(qw(
XML::Filter::Bar
XML::Filter::Baz
>output_file.xml
));
And, thanks to Perl's magic open (see perlopentut), you can read and write from processes:
my $m = Pipeline(
"gen_xml.pl |",
"XML::Filter::Bar",
"XML::Filter::Baz",
"| consume_xml.pl",
);
This can be used with an XML::SAX::Tap to place a handy debugging tap in a pipeline (or other machine):
my $m = Pipeline(
"<input_file.xml"
"XML::Filter::Bar",
Tap( "| xmllint --format -" ),
"XML::Filter::Baz",
">output_file.xml",
);
METHODS
See XML::SAX::Machine for most of the methods.
new
my $pipeline = XML::SAX::Pipeline->new( @processors, \%options );
Creates a pipeline and links all of the given processors together. Longhand for Pipeline().
AUTHOR
Barrie Slaymaker <barries@slaysys.com>
COPYRIGHT
Copyright 2002, Barrie Slaymaker, All Rights Reserved.
You may use this module under the terms of the Artistic, GNU Public, or BSD licenses, your choice.
perl v5.10.0 2009-06-11 XML::SAX::Pipeline(3pm)