Is there possible to do vlookup in Mysql one table from another table based on one column values and placed the data in same table?
if it is possible in mysql itself pls share links for reference.
Here is the ex: i need to vlookup the cus.id in table to and place the cus.name in 4th column of table 1.
Table 1
Thanks..
Last edited by Shenbaga.d; 01-09-2015 at 09:00 AM..
Reason: adding info
Hello,
I am trying to use vlookup (Excel function) using awk but there is some problem :(
--file1--
ABC123
101F
X1 A $P=Z
X2 A $P=X
X3 B $P=F
X4 C $P=G
MNK180
END
--file2--
X1 A_t $P=Z
X2 A_t $P=X
X3 B_u $P=F
X4 C_o $P=G (2 Replies)
Hi,
I am new to awk/unix and am trying to put together an awk script to perform an action similar to vlookup between the two csv files.
Here are the contents of the two files:
File 1:
Date,ParentID,Number,Area,Volume,Dimensions
2014-01-01,ABC,247,83430.33,857.84,8110.76... (9 Replies)
Hi folks,
awk 'NR==FNR {m=$0; next} $1 in m{$0=m} {print}' file2 file1
Works a charm for a vlookup type query, sourced from https://www.unix.com/shell-programming-and-scripting/215998-vlookup-using-awk.html
However my column content has white spaces and numbers. Example
file1
The Man... (6 Replies)
Code used to find the server from cloum 3 and update needtotakesnap
Output came from above command
awk 'NR==FNR{A;next}$3 in A{$3 = "needtotakesnap " $3}1' /home/Others/active-server.txt /home/Others/all-server |grep server1
879 dummy server1_217_silver dummy 00870 TDEV 2071575
831 Tier1... (3 Replies)
I need to vlookup and check the server not found.
Source file 1
server1
server2
server3
server4
server5_root
server6_silver
server7
server7-test
server7-temp
Source file 2
server1_bronze (6 Replies)
Hello Folks,
What I wish to do is:
If first column matches in main and new file, then
paste $COL2 into output file. Something like vlookup. Please see also bold text in expected output.
mainfile
11
22
33
44
55
66
77
88
99
100
101
102 (4 Replies)
Hello, i am trying to print group name column(etc/group) on script (etc/passwd) since group name is not listed on etc/passwd columns. Im trying to do a vlookup. but i cant figure out how i can insert the vlookup command FNR==NR inside the print out command or the output. I also tried exporting... (2 Replies)
Hi I just want again to ask for help on what command to use to vlookup f1 group name in "/etc/group" matching f3 of it to "/etc/passwd" f4. I do need to display group name in the output of /etc/passwd without using awk or NR==FNR command. thank you
while
IFS=: read -r f1 f2 f3 f4 f5 f6 f7... (4 Replies)
Discussion started by: joonisio
4 Replies
LEARN ABOUT DEBIAN
spreadsheet::writeexcel::chart::stock
Spreadsheet::WriteExcel::Chart::Stock(3pm) User Contributed Perl Documentation Spreadsheet::WriteExcel::Chart::Stock(3pm)NAME
Stock - A writer class for Excel Stock charts.
SYNOPSIS
To create a simple Excel file with a Stock chart using Spreadsheet::WriteExcel:
#!/usr/bin/perl -w
use strict;
use Spreadsheet::WriteExcel;
my $workbook = Spreadsheet::WriteExcel->new( 'chart.xls' );
my $worksheet = $workbook->add_worksheet();
my $chart = $workbook->add_chart( type => 'stock' );
# Add a series for each Open-High-Low-Close.
$chart->add_series( categories => '=Sheet1!$A$2:$A$6', values => '=Sheet1!$B$2:$B$6' );
$chart->add_series( categories => '=Sheet1!$A$2:$A$6', values => '=Sheet1!$C$2:$C$6' );
$chart->add_series( categories => '=Sheet1!$A$2:$A$6', values => '=Sheet1!$D$2:$D$6' );
$chart->add_series( categories => '=Sheet1!$A$2:$A$6', values => '=Sheet1!$E$2:$E$6' );
# Add the worksheet data the chart refers to.
# ... See the full example below.
__END__
DESCRIPTION
This module implements Stock charts for Spreadsheet::WriteExcel. The chart object is created via the Workbook "add_chart()" method:
my $chart = $workbook->add_chart( type => 'stock' );
Once the object is created it can be configured via the following methods that are common to all chart classes:
$chart->add_series();
$chart->set_x_axis();
$chart->set_y_axis();
$chart->set_title();
These methods are explained in detail in Spreadsheet::WriteExcel::Chart. Class specific methods or settings, if any, are explained below.
Stock Chart Methods
There aren't currently any stock chart specific methods. See the TODO section of Spreadsheet::WriteExcel::Chart.
The default Stock chart is an Open-High-Low-Close chart. A series must be added for each of these data sources.
The default Stock chart is in black and white. User defined colours will be added at a later stage.
EXAMPLE
Here is a complete example that demonstrates most of the available features when creating a Stock chart.
#!/usr/bin/perl -w
use strict;
use Spreadsheet::WriteExcel;
my $workbook = Spreadsheet::WriteExcel->new( 'chart_stock_ex.xls' );
my $worksheet = $workbook->add_worksheet();
my $bold = $workbook->add_format( bold => 1 );
my $date_format = $workbook->add_format( num_format => 'dd/mm/yyyy' );
# Add the worksheet data that the charts will refer to.
my $headings = [ 'Date', 'Open', 'High', 'Low', 'Close' ];
my @data = (
[ '2009-08-23', 110.75, 113.48, 109.05, 109.40 ],
[ '2009-08-24', 111.24, 111.60, 103.57, 104.87 ],
[ '2009-08-25', 104.96, 108.00, 103.88, 106.00 ],
[ '2009-08-26', 104.95, 107.95, 104.66, 107.91 ],
[ '2009-08-27', 108.10, 108.62, 105.69, 106.15 ],
);
$worksheet->write( 'A1', $headings, $bold );
my $row = 1;
for my $data ( @data ) {
$worksheet->write( $row, 0, $data->[0], $date_format );
$worksheet->write( $row, 1, $data->[1] );
$worksheet->write( $row, 2, $data->[2] );
$worksheet->write( $row, 3, $data->[3] );
$worksheet->write( $row, 4, $data->[4] );
$row++;
}
# Create a new chart object. In this case an embedded chart.
my $chart = $workbook->add_chart( type => 'stock', embedded => 1 );
# Add a series for each of the Open-High-Low-Close columns.
$chart->add_series(
categories => '=Sheet1!$A$2:$A$6',
values => '=Sheet1!$B$2:$B$6',
name => 'Open',
);
$chart->add_series(
categories => '=Sheet1!$A$2:$A$6',
values => '=Sheet1!$C$2:$C$6',
name => 'High',
);
$chart->add_series(
categories => '=Sheet1!$A$2:$A$6',
values => '=Sheet1!$D$2:$D$6',
name => 'Low',
);
$chart->add_series(
categories => '=Sheet1!$A$2:$A$6',
values => '=Sheet1!$E$2:$E$6',
name => 'Close',
);
# Add a chart title and some axis labels.
$chart->set_title( name => 'Open-High-Low-Close', );
$chart->set_x_axis( name => 'Date', );
$chart->set_y_axis( name => 'Share price', );
# Insert the chart into the worksheet (with an offset).
$worksheet->insert_chart( 'F2', $chart, 25, 10 );
__END__
AUTHOR
John McNamara jmcnamara@cpan.org
COPYRIGHT
Copyright MM-MMX, John McNamara.
All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.
perl v5.10.1 2010-02-02 Spreadsheet::WriteExcel::Chart::Stock(3pm)