Hi all,
in my csv file it'll look like this, and of course it may have more columns
US to UK;abc-hq-jcl;multimedia
UK to CN;def-ny-jkl;standard
DE to DM;abc-ab-klm;critical
FD to YM;la-yr-tym;standard
HY to MC;la-yr-ytm;multimedia
GT to KJ;def-ny-jrt;critical
I would like to group... (4 Replies)
Hi All,
I am newbie to Unix I ve got assignment to work in unix
can you please help me in this regard
There is a sample CSV file
"Username", "Password"
"John1", "Scot1"
"John2", "Scot2"
"John3", "Scot3"
"John4", "Scot4"
If i give the column name as Password and row number as 4 the... (3 Replies)
My scenario is that I need to pick value from third column based on fourth column value, if fourth column value is 1 then first value of third column.Third column (2|3|4|6|1) values are cancatenated.
Main imp point, in my .csv file, third column is having price value with comma (1,20,300), it has... (2 Replies)
Hi all,
I am new to shell script.I need your help to write a shell script.
I need to write a shell script to extract data from a .csv file where columns are ',' separated.
The file has 5 columns having values say column 1,column 2.....column 5 as below along with their valuesm.... (3 Replies)
I have a .CSV file with the below format:
"column 1","column 2","column 3","column 4","column 5","column 6","column 7","column 8","column 9","column 10
"12310","42324564756","a simple string with a , comma","string with or, without commas","string 1","USD","12","70%","08/01/2013",""... (2 Replies)
input.csv:
Field1,Field2,Field3,Field4,Field4
abc ,123 ,xyz ,000 ,pqr
mno ,123 ,dfr ,111 ,bbb
output:
Field2,Field4
123 ,000
123 ,111
how to fetch the values of Field4 where Field2='123'
I don't want to fetch the values based on column position. Instead want to... (10 Replies)
cat sample.csv
ID,Name,no
1,AAA,1
2,BBB,1
3,AAA,1
4,BBB,1
cut -d',' -f2 sample.csv | sort | uniq
this gives only the 2nd column values
Name
AAA
BBB
How to I get all the columns of CSV along with this? (1 Reply)
Hello,
I want to get the maximum value of each record separated by empty line based on the 3rd column of each row within each record?
Input:
A1 chr5D 634 7 82 707
A2 chr5D 637 6 82 713
A3 chr5D 637 5 82 713
A4 chr5D 626 1 82 704... (4 Replies)
Hi,
I tried filtering the records in a csv file using "awk" command listed below.
awk -F"~" '$4 ~ /Active/{print }' inputfile > outputfile
The output always has all the entries.
The same command worked for different users from one of the forum links.
content of file I was... (3 Replies)
I have a csv file as shown below,
xop_thy 80 avr_njk 50 str_nyu 60
avr_irt 70 str_nhj 60 avr_ngt 50
str_tgt 80 xop_nmg 50 xop_nth 40
cyv_gty 40 cop_thl 40 vir_tyk 80
vir_plo 20 vir_thk 40 ijk_yuc 70
cop_thy 70 ijk_yuc 80 irt_hgt 80
I need to align/sort the csv file based... (7 Replies)
Discussion started by: dineshkumarsrk
7 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)