LoginSignup
0

More than 5 years have passed since last update.

Spreadsheet::WriteExcelのTips

Last updated at Posted at 2016-12-27

テキスト形式での指定方法いろいろ

# Implicitly write a number, the leading zero is removed: 1209
$worksheet->write('A1', '01209');

# Write a zero padded number using a format: 01209
my $format1 = $workbook->add_format(num_format => '00000');
$worksheet->write('A2', '01209', $format1);

# Write explicitly as a string: 01209
$worksheet->write_string('A3', '01209');

# Write implicitly as a string: 01209
$worksheet->keep_leading_zeros();
$worksheet->write('A4', '01209');

# これが正解
# Format as a string (01209)
my $format2 = $workbook->add_format(num_format => '@');
$worksheet->write_string('A5', '01209', $format2);

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0