hi everybody,
i have a file, in it I need to extract some data that follows a particular pattern..
For example: my file contains like
now running Speak225
sep 22 mon 16:34:05 2008
--------------------------------
... (4 Replies)
Hi All,
I have a requirement where I have to search the file with some text say "Exception". This exception word can be repeated for more then 10 times.
Suppose the "Exception" word is repeated at line numbers say x=10, 50, 60, 120. Now I want to extract all the lines starting from x-5 to... (3 Replies)
Hi Freinds,
I have a file1.txt in the following format
File1.txt
I want to get 2 files from the above file filextra.txt should have the lines which are ending with "<" and remaining lines in the filecompare.txt file.
Please help. (3 Replies)
FILE_ID extraction from file name and save it in CSV file after looping through each folders
My files are located in UNIX Server, i want to extract file_id and file_name from each file .and save it in a CSV file. How do I do that?
I have folders in unix environment, directory structure is... (15 Replies)
Hey all,
i´ve got the following problem:
i´m aquiring data with an instrument and i get data in a .txt file.
This is how the txt file looks like:
Report of AU program poptau
F1P=-49.986ppm F2P=-110.014ppm
Target directory for serfile: D:/data/Spect500/nmr/Thoma/882
Linear... (17 Replies)
Hallo Friends,
I need you help. My file has 5000 or so lines and currently looks like below(sample).
Service Type,Origin,Destination,Rate Per Minute,Minimum Charge,Time Based Rate,Time Based From Day,Time Based To Day,Time Based From Time,Time Based To Time,Destination Prefix List,,
VoIS... (3 Replies)
Hi, I am newbie in shell script.
I need your help to solve my problem.
Firstly, I have 2 files of csv and i want to compare of the contents then the output will be written in a new csv file.
File1:
SourceFile,DateTimeOriginal
/home/intannf/foto/IMG_0713.JPG,2015:02:17 11:14:07... (8 Replies)
Hello,
I'm attempting to extract 13 digit numbers beginning with 978 from a data file with the following command:
awk '{ for(i=1;i<=NF;i++) if($i ~ /^978/) print $i; }' datafile > outfile
This typically works. However, the new data file is an .xml file, and this command is no longer working... (6 Replies)
Hi All,
I have a data file and need to extract and convert it into csv format:
1) Read and extract the line containing string ending with "----" (file sample_linebyline.txt file) and to make a .csv file from this.
2) To read the flat file flatfile_sample.txt which consists of similar data (... (9 Replies)
Discussion started by: abhi_123
9 Replies
LEARN ABOUT DEBIAN
text::csv::encoded::coder::base
Text::CSV::Encoded::Coder::Base(3pm) User Contributed Perl Documentation Text::CSV::Encoded::Coder::Base(3pm)NAME
Text::CSV::Encoded::Coder::Base - Interface for Text::CSV::Encoded coder base class
SYNOPSIS
package Text::CSV::Encoded::Coder::YourCoder;
use base qw( Text::CSV::Encoded::Coder::Base );
sub decode {
...
}
sub encode {
...
}
sub upgrade {
...
}
sub decode_fields_ref {
...
}
sub encode_fields_ref {
...
}
DESCRIPTION
This module is used by Text::CSV::Encoded internally.
INTERFACS
decode
( $self, $encoding, $str ) = @_;
....
return $decoded_str;
Takes an encoding and a CSV string. It must return a Perl string decoded in $encoding. In Perl 5.8 or later, if $enc is "undef" or false,
the encoding should be utf8.
encode
( $self, $encoding, $str ) = @_;
....
return $encoded_str;
Takes an encoding and a Perl string. It must return a CSV string encoded in $encoding. In Perl 5.8 or later, if $enc is "undef" or false,
the encoding should be utf8.
decode_fields_ref
( $self, $encoding, $arrayref ) = @_;
Takes an encoding and an array reference. It must decoded each array entries in $encoding.
encode_fields_ref
( $self, $encoding, $arrayref ) = @_;
Takes an encoding and an array reference. It must encoded each array entries in $encoding.
upgrade
( $self, $str ) = @_;
In Perl 5.8 or later, it is expected to do "utf8::upgrade" against $str. In older versions, this method may be meaningless and there is no
need to implement. See to utf8.
encode_check_value
Setter/Getter for an argument passing to encode.
$coder->encode_check_value( Encode::FB_PERLQQ );
decode_check_value
Setter/Getter for an argument passing to decode.
$coder->encode_check_value( Encode::FB_PERLQQ );
EXAMPLE
Use with Jcode.
package Text::CSV::Encoded::Coder::Jcode;
use strict;
use base qw( Text::CSV::Encoded::Coder::Base );
use Jcode ();
my $Jcode = Jcode->new;
my %alias = (
'shiftjis' => 'sjis',
'euc-jp' => 'euc',
'sjis' => 'sjis',
'euc' => 'euc',
);
sub decode {
my ( $self, $encoding, $str ) = @_;
my $enc = $alias{ $encoding };
$Jcode->set( $str, $enc )->euc;
}
sub encode {
my ( $self, $encoding, $str ) = @_;
my $enc = $alias{ $encoding };
$Jcode->set( $str, 'euc' )->$enc();
}
sub decode_fields_ref {
my ( $self, $encoding, $arrayref ) = @_;
my $enc = $alias{ $encoding };
for ( @$arrayref ) {
$_ = $Jcode->set( $_, $enc )->euc;
}
}
sub encode_fields_ref {
my ( $self, $encoding, $arrayref ) = @_;
my $enc = $alias{ $encoding };
for ( @$arrayref ) {
$_ = $Jcode->set( $_, 'euc' )->$enc();
}
}
AUTHOR
Makamaka Hannyaharamitu, <makamaka[at]cpan.org>
COPYRIGHT AND LICENSE
Copyright 2008-2010 by Makamaka Hannyaharamitu
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2010-04-26 Text::CSV::Encoded::Coder::Base(3pm)