in reply to search and delete comma delimited file
Try this on for size. It reads your file using the standard Text::CSV_XS module and prints just the domain field.
use strict; use warnings; use constant { FIELD_Unknown_1 => 0, FIELD_CompanyName => 1, FIELD_Unknown_2 => 2, FIELD_Domain => 3, FIELD_Status => 4, FIELD_Unknown_3 => 5, FIELD_Unknown_4 => 6, FIELD_Unknown_5 => 7, }; my $parser = Text::CSV_XS->new(); while ( my $line = <> ) { $parser->parse( $line ); my @columns = $parser->fields; my @new_columns = @columns[ FIELD_Domain, ]; $parser->combine( @new_columns ); print $parser->string; }
|
|---|