<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Coverting csv file to binary in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517797#M219345</link>
    <description>Hi guys, &lt;BR /&gt;&lt;BR /&gt; Manage to fix the problem and make the module work. However, I was wondering whether i could modify the script to convert binary to csv as well.. &lt;BR /&gt;&lt;BR /&gt;can be done?&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Henry</description>
    <pubDate>Fri, 08 Apr 2005 19:25:46 GMT</pubDate>
    <dc:creator>Henry Chua</dc:creator>
    <dc:date>2005-04-08T19:25:46Z</dc:date>
    <item>
      <title>Coverting csv file to binary</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517786#M219334</link>
      <description>Hi guys,&lt;BR /&gt;&lt;BR /&gt;  Is there a way to covert csv file to its binary equivalent. I have attached the sample files. &lt;BR /&gt;&lt;BR /&gt;Hope u guys can help me out..&lt;BR /&gt;thanks!!&lt;BR /&gt;&lt;BR /&gt;Henry</description>
      <pubDate>Tue, 05 Apr 2005 03:48:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517786#M219334</guid>
      <dc:creator>Henry Chua</dc:creator>
      <dc:date>2005-04-05T03:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting csv file to binary</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517787#M219335</link>
      <description>attached is its binary file equivalent..</description>
      <pubDate>Tue, 05 Apr 2005 03:49:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517787#M219335</guid>
      <dc:creator>Henry Chua</dc:creator>
      <dc:date>2005-04-05T03:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting csv file to binary</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517788#M219336</link>
      <description>can you tell us what the "binary" format is?&lt;BR /&gt;&lt;BR /&gt;I've looked at the binary file but it has things missing from the original file.&lt;BR /&gt;&lt;BR /&gt;I even saw a backspace character in it (which is weird for a file format).&lt;BR /&gt;&lt;BR /&gt;How did you get the cvs file into that binary format?&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry d brown jr</description>
      <pubDate>Tue, 05 Apr 2005 07:19:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517788#M219336</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2005-04-05T07:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting csv file to binary</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517789#M219337</link>
      <description># perl -MText::CSV_XS -le'$c=Text::CSV_XS-&amp;gt;new({binary=&amp;gt;1});while(&amp;lt;&amp;gt;){$c-&amp;gt;parse($_);print$c-&amp;gt;fields}' file.csv &amp;gt; file.dta&lt;BR /&gt;&lt;BR /&gt;BUT!&lt;BR /&gt;&lt;BR /&gt;M$ has never been able to read the specs. CSV is shorthand for COMMA Separated Values, and guess what M$ uses? Right, a semicolon. So in order to convert microshit generated csv files, you need&lt;BR /&gt;&lt;BR /&gt;# perl -MText::CSV_XS -le'$c=Text::CSV_XS-&amp;gt;new({binary=&amp;gt;1,sep_char=&amp;gt;";"});while(&amp;lt;&amp;gt;){$c-&amp;gt;parse($_);print$c-&amp;gt;fields}' file.csv &amp;gt; file.dta&lt;BR /&gt;&lt;BR /&gt;HTH, Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Tue, 05 Apr 2005 07:36:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517789#M219337</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2005-04-05T07:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting csv file to binary</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517790#M219338</link>
      <description>If you are trying to import the cvs file into M$ decel (I mean excel) then just use the wizard and change the default from a ; to a ,&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry d brown jr</description>
      <pubDate>Tue, 05 Apr 2005 07:40:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517790#M219338</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2005-04-05T07:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting csv file to binary</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517791#M219339</link>
      <description>Hi MeiJin,&lt;BR /&gt;&lt;BR /&gt;  Sorry I am new to Perl, can u explain how your script actually works.. I tried running it on my system. doesnt seem to work&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Henry</description>
      <pubDate>Tue, 05 Apr 2005 08:00:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517791#M219339</guid>
      <dc:creator>Henry Chua</dc:creator>
      <dc:date>2005-04-05T08:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting csv file to binary</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517792#M219340</link>
      <description>Hi Harry,&lt;BR /&gt;&lt;BR /&gt;  What I really want to do is to convert csv file to its binary equivalent. This binary file is generated by a customise program, in actual I am not even sure if the conversion is possible.. just trying my luck..&lt;BR /&gt;&lt;BR /&gt;Thanks!! =)&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Henry</description>
      <pubDate>Tue, 05 Apr 2005 08:03:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517792#M219340</guid>
      <dc:creator>Henry Chua</dc:creator>
      <dc:date>2005-04-05T08:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting csv file to binary</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517793#M219341</link>
      <description>I've never before seen my name spelt like that :)&lt;BR /&gt;&lt;BR /&gt;perl -MText::CSV_XS -le'$c=Text::CSV_XS-&amp;gt;new({binary=&amp;gt;1,sep_char=&amp;gt;";"});while(&amp;lt;&amp;gt;){$c-&amp;gt;parse($_);print$c-&amp;gt;fields}' file.csv &amp;gt; file.dta&lt;BR /&gt;&lt;BR /&gt;is more verbose,as a script, more or less the same as (with comments):&lt;BR /&gt;&lt;BR /&gt;--8&amp;lt;--- csv2bin.pl&lt;BR /&gt;#!/opt/perl/bin/perl&lt;BR /&gt;# this line tell where your perl resides&lt;BR /&gt;&lt;BR /&gt;use strict; # Don't allow ambiguous code&lt;BR /&gt;use warnings; # Warn me wherever appropriate&lt;BR /&gt;&lt;BR /&gt;use Text::CSV_XS; # use the Text::CSV_XS module.&lt;BR /&gt;# Should be installed from CPAN or bundled in the port you got&lt;BR /&gt;&lt;BR /&gt;my $csv = Text::CSV_XS-&amp;gt;new ({ # create a new csv handle&lt;BR /&gt;binary =&amp;gt; 1, # that uses binary data&lt;BR /&gt;sep_char =&amp;gt; ";", # and a semicolon as separator&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;# Now parse the input lines&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt;$csv-&amp;gt;parse ($_); # break down as valid csv&lt;BR /&gt;print $csv-&amp;gt;fields; # and print the fields as binary&lt;BR /&gt;}&lt;BR /&gt;--&amp;gt;8---&lt;BR /&gt;&lt;BR /&gt;First check if you have perl, and what version:&lt;BR /&gt;&lt;BR /&gt;# perl -v&lt;BR /&gt;&lt;BR /&gt;If you don't have it (yet), you can get it from my site, and my builds include CSV_XS&lt;BR /&gt;&lt;BR /&gt;My HP ITRC site pages can be found at (please use LA as primary choice):&lt;BR /&gt;&lt;BR /&gt;USA Los Angeles &lt;A href="http://mirrors.develooper.com/hpux/" target="_blank"&gt;http://mirrors.develooper.com/hpux/&lt;/A&gt;&lt;BR /&gt;SGP Singapore   &lt;A href="https://www.beepz.com/personal/merijn/" target="_blank"&gt;https://www.beepz.com/personal/merijn/&lt;/A&gt;&lt;BR /&gt;USA Chicago     &lt;A href="http://ww.hpux.ws/merijn/" target="_blank"&gt;http://ww.hpux.ws/merijn/&lt;/A&gt;&lt;BR /&gt;NL  Hoofddorp   &lt;A href="http://www.cmve.net/~merijn/" target="_blank"&gt;http://www.cmve.net/~merijn/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Tue, 05 Apr 2005 08:14:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517793#M219341</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2005-04-05T08:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting csv file to binary</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517794#M219342</link>
      <description>Hi Merijn,&lt;BR /&gt;&lt;BR /&gt;  Sorry for getting your name wrong. =p&lt;BR /&gt;&lt;BR /&gt;I have gotten this when i probed the machine.&lt;BR /&gt;&lt;BR /&gt;This is perl, version 4.0&lt;BR /&gt;&lt;BR /&gt;$RCSfile: perl.c,v $$Revision: 4.0.1.8 $$Date: 1993/02/05 19:39:30 $&lt;BR /&gt;Patch level: 36&lt;BR /&gt;&lt;BR /&gt;Copyright (c) 1989, 1990, 1991, Larry Wall&lt;BR /&gt;&lt;BR /&gt;Perl may be copied only under the terms of either the Artistic License or the&lt;BR /&gt;GNU General Public License, which may be found in the Perl 4.0 source kit.&lt;BR /&gt;&lt;BR /&gt;Will this version work? Where can I grt the "CSV_XS" for this version? &lt;BR /&gt;&lt;BR /&gt;Thank u for your help..&lt;BR /&gt;&lt;BR /&gt;=)&lt;BR /&gt;Regards&lt;BR /&gt;Henry&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 05 Apr 2005 20:29:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517794#M219342</guid>
      <dc:creator>Henry Chua</dc:creator>
      <dc:date>2005-04-05T20:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting csv file to binary</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517795#M219343</link>
      <description>Perl 4 is basically useless except to run the q4 dump analyzer. Perl 5 should be downloaded from software.hp.com and installed on your machine.</description>
      <pubDate>Tue, 05 Apr 2005 21:00:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517795#M219343</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-04-05T21:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting csv file to binary</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517796#M219344</link>
      <description>Hi Merijn,&lt;BR /&gt;&lt;BR /&gt;I gotten this when I try to run the script..&lt;BR /&gt;"Can't locate Text/CSV_XS.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-l.&lt;BR /&gt;BEGIN failed--compilation aborted at ./test line 7."&lt;BR /&gt;&lt;BR /&gt;do you know what i did wrong? how can i get the csv_xs.pm package?&lt;BR /&gt;&lt;BR /&gt;best regards&lt;BR /&gt;Henry</description>
      <pubDate>Wed, 06 Apr 2005 11:15:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517796#M219344</guid>
      <dc:creator>Henry Chua</dc:creator>
      <dc:date>2005-04-06T11:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting csv file to binary</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517797#M219345</link>
      <description>Hi guys, &lt;BR /&gt;&lt;BR /&gt; Manage to fix the problem and make the module work. However, I was wondering whether i could modify the script to convert binary to csv as well.. &lt;BR /&gt;&lt;BR /&gt;can be done?&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Henry</description>
      <pubDate>Fri, 08 Apr 2005 19:25:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517797#M219345</guid>
      <dc:creator>Henry Chua</dc:creator>
      <dc:date>2005-04-08T19:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting csv file to binary</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517798#M219346</link>
      <description>If you pass out some points to reflect the appreciation of the answers, I could give you the hint to use unpack or split and Text::CSV_XS to do the reverse. I could even bshow you some code.&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Sat, 09 Apr 2005 12:15:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517798#M219346</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2005-04-09T12:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting csv file to binary</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517799#M219347</link>
      <description>No problem... ^_^</description>
      <pubDate>Sat, 09 Apr 2005 12:45:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517799#M219347</guid>
      <dc:creator>Henry Chua</dc:creator>
      <dc:date>2005-04-09T12:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting csv file to binary</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517800#M219348</link>
      <description>OK, here's a real-life script that would convert almost anything text-like to csv or M$-Excel. You don't have (nor can get) PROCURA::Diac, so you need to find other methods to deal with Unicode conversions (Encode is a good start)&lt;BR /&gt;&lt;BR /&gt;Spreadsheet::WriteExcel and Date::Calc are both included in my perl builds and are available on CPAN. The advantage of writing xls yourself, instead of having M$-Excel do it on import or open is that you have control over the dates, instead of having M$ fuck-up all valid dates to be forced to braindead US format&lt;BR /&gt;&lt;BR /&gt;Also attached to have your script retain format. Hey, I even have a usage sub :)&lt;BR /&gt;--8&amp;lt;--- append_csv&lt;BR /&gt;#!/pro/bin/perl&lt;BR /&gt;&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;&lt;BR /&gt;sub usage ()&lt;BR /&gt;{&lt;BR /&gt;    print STDERR&lt;BR /&gt;        "usage: $0    [-c utf8|iso8859] [-i &lt;SEP&gt;] [-o &lt;SEP&gt; | -ms] [out_file]\n&lt;BR /&gt;",&lt;BR /&gt;        "       $0 -x [-c utf8|iso8859] [-d &lt;DATE-FORMAT&gt;] [-w &lt;COLUMN-WIDTH&gt;] o&lt;BR /&gt;utfile\n";&lt;BR /&gt;    exit;&lt;BR /&gt;    } # usage&lt;BR /&gt;&lt;BR /&gt;use Getopt::Long qw( :config bundling nopermute);&lt;BR /&gt;my $codep = $ENV{UTF8_OK} // 0 ? "utf8" : "iso8859-1";&lt;BR /&gt;my $i_sep = qr/\s*\|\s?/;&lt;BR /&gt;my $o_sep = ",";&lt;BR /&gt;my $pfx   = "";&lt;BR /&gt;my $xls   = 0;&lt;BR /&gt;my $dtf   = "dd-mm-yyyy";       # Excel date format&lt;BR /&gt;my $wdt   = 4;                  # Default minimal column width&lt;BR /&gt;GetOptions (&lt;BR /&gt;    "c|codep=s"   =&amp;gt; \$codep,&lt;BR /&gt;    # CSV stuff&lt;BR /&gt;#!/pro/bin/perl&lt;BR /&gt;&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;&lt;BR /&gt;sub usage ()&lt;BR /&gt;{&lt;BR /&gt;    print STDERR&lt;BR /&gt;        "usage: $0    [-c utf8|iso8859] [-i &lt;SEP&gt;] [-o &lt;SEP&gt; | -ms] [out_file]\n&lt;BR /&gt;",&lt;BR /&gt;        "       $0 -x [-c utf8|iso8859] [-d &lt;DATE-FORMAT&gt;] [-w &lt;COLUMN-WIDTH&gt;] o&lt;BR /&gt;utfile\n";&lt;BR /&gt;    exit;&lt;BR /&gt;    } # usage&lt;BR /&gt;&lt;BR /&gt;use Getopt::Long qw( :config bundling nopermute);&lt;BR /&gt;my $codep = $ENV{UTF8_OK} // 0 ? "utf8" : "iso8859-1";&lt;BR /&gt;my $i_sep = qr/\s*\|\s?/;&lt;BR /&gt;my $o_sep = ",";&lt;BR /&gt;my $pfx   = "";&lt;BR /&gt;my $xls   = 0;&lt;BR /&gt;my $dtf   = "dd-mm-yyyy";       # Excel date format&lt;BR /&gt;my $wdt   = 4;                  # Default minimal column width&lt;BR /&gt;GetOptions (&lt;BR /&gt;    "c|codep=s"   =&amp;gt; \$codep,&lt;BR /&gt;    # CSV stuff&lt;BR /&gt;    "i=s"         =&amp;gt; sub { $i_sep = qr{$_[1]} },&lt;BR /&gt;    "o|csv=s"     =&amp;gt; \$o_sep,&lt;BR /&gt;    "m|ms"        =&amp;gt; sub { $o_sep = ";" }, # Micro$hit expects semi-colon&lt;BR /&gt;    # Excel stuff&lt;BR /&gt;    "x|xls|excel" =&amp;gt; \$xls,&lt;BR /&gt;    "d|date=s"    =&amp;gt; \$dtf,&lt;BR /&gt;    "w|cwidth=i"  =&amp;gt; \$wdt,&lt;BR /&gt;    ) or usage;&lt;BR /&gt;&lt;BR /&gt;use Text::CSV_XS;&lt;BR /&gt;use Date::Calc qw( Delta_Days );&lt;BR /&gt;use Spreadsheet::WriteExcel;&lt;BR /&gt;use PROCURA::Diac;&lt;BR /&gt;&lt;BR /&gt;my $mode = $0 =~ m/clr/ ? "&amp;gt; " : "&amp;gt;&amp;gt; ";&lt;BR /&gt;if (@ARGV) {&lt;BR /&gt;    my $ofile = shift;&lt;BR /&gt;    if ($xls) {&lt;BR /&gt;        ($xls = $ofile) =~ s/(\.xls)?$/.xls/i;&lt;BR /&gt;        }&lt;BR /&gt;    else {&lt;BR /&gt;        open STDOUT, "$mode $ofile" or die "$ofile: $!\n";&lt;BR /&gt;        }&lt;BR /&gt;    }&lt;BR /&gt;elsif ($xls) {&lt;BR /&gt;    die "Excel formaat kan niet naar stadaard uit.\n";&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;my ($h, $w, $csv, $wbk, $wks, %fmt, @w) = (0, 1);&lt;BR /&gt;if ($xls) {&lt;BR /&gt;    $wbk = Spreadsheet::WriteExcel-&amp;gt;new ($xls);&lt;BR /&gt;    $wks = $wbk-&amp;gt;add_worksheet ();&lt;BR /&gt;    %fmt = (&lt;BR /&gt;        date =&amp;gt; $wbk-&amp;gt;add_format (align =&amp;gt; "center", num_format =&amp;gt; $dtf),&lt;BR /&gt;        rest =&amp;gt; $wbk-&amp;gt;add_format (align =&amp;gt; "left"),&lt;BR /&gt;        );&lt;BR /&gt;    }&lt;BR /&gt;else {&lt;BR /&gt;    $csv = Text::CSV_XS-&amp;gt;new ({&lt;BR /&gt;        binary       =&amp;gt; 1,&lt;BR /&gt;        sep_char     =&amp;gt; $o_sep,&lt;BR /&gt;        always_quote =&amp;gt; 1,&lt;BR /&gt;        });&lt;BR /&gt;    }&lt;BR /&gt;my $p_tex = $codep =~ m/^u(tf-?8|nicode)$/i ? \&amp;amp;TexUnicode : # utf-8, utf8, unic&lt;BR /&gt;ode&lt;BR /&gt;            $codep =~ m/8859\D9|latin5/i    ? \&amp;amp;Tex8859_9  : # iso8859-9, latin5&lt;BR /&gt;            $codep =~ m/none|strip|cs7/i    ? \&amp;amp;TexNone    : # none, strip, cs7&lt;BR /&gt;                                              \&amp;amp;Tex8859_1;   # * (iso8859-1, lat&lt;BR /&gt;in1)&lt;BR /&gt;$p_tex == \&amp;amp;TexUnicode and binmode STDOUT, ":utf8";&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt;    chomp;&lt;BR /&gt;    m/\S/ or next;&lt;BR /&gt;    s/^\s+//;&lt;BR /&gt;    my @row = split $i_sep, $_, -1;&lt;BR /&gt;    if ($xls) {&lt;BR /&gt;        @row &amp;gt; $w and push @w, ($wdt) x (($w = @row) - @w);&lt;BR /&gt;        foreach my $c (0 .. $#row) {&lt;BR /&gt;            (my $val = $row[$c]) =~ s/^\s+//;&lt;BR /&gt;            my $l = length $val;&lt;BR /&gt;            $l &amp;gt; $w[$c] and $w[$c] = $l;&lt;BR /&gt;            my @d = (0, 0, 0);  # Y, M, D&lt;BR /&gt;            $val =~ m/^(\d{4})(\d{2})(\d{2})$/   and @d = ($1, $2, $3);&lt;BR /&gt;            $val =~ m/^(\d{2})-(\d{2})-(\d{4})$/ and @d = ($3, $2, $1);&lt;BR /&gt;            if ($d[1] &amp;gt;= 1 &amp;amp;&amp;amp; $d[1] &amp;lt;= 12 &amp;amp;&amp;amp; $d[0] &amp;gt;= 1900) {&lt;BR /&gt;                my $dt = 2 + Delta_Days (1900, 1, 1, @d);&lt;BR /&gt;                $wks-&amp;gt;write ($h, $c, $dt, $fmt{date});&lt;BR /&gt;                next;&lt;BR /&gt;                }&lt;BR /&gt;            if ($val =~ m/^[\d.]{10,}$/) {&lt;BR /&gt;                # Excel will convert long numericals to float&lt;BR /&gt;                # 1000101222101220 ...&lt;BR /&gt;                # It's in this case much more likely that it is a string&lt;BR /&gt;                $wks-&amp;gt;write_string ($h, $c, $val);&lt;BR /&gt;                }&lt;BR /&gt;            else {&lt;BR /&gt;                $wks-&amp;gt;write ($h, $c, $val);&lt;BR /&gt;                }&lt;BR /&gt;            }&lt;BR /&gt;        }&lt;BR /&gt;    else {&lt;BR /&gt;        unless ($csv-&amp;gt;combine (@row)) {&lt;BR /&gt;            print STDERR "Data error: ", $csv-&amp;gt;error_input, "\n";&lt;BR /&gt;            exit;&lt;BR /&gt;            }&lt;BR /&gt;        print $p_tex-&amp;gt;($csv-&amp;gt;string), "\r\n";&lt;BR /&gt;        }&lt;BR /&gt;    ++$h % 100 or printf STDERR "%6d x %6d\r", $w, $h;&lt;BR /&gt;    }&lt;BR /&gt;if ($xls) {&lt;BR /&gt;    $wks-&amp;gt;set_column ($_, $_, $w[$_]) for 0 .. $#w;&lt;BR /&gt;    $wbk-&amp;gt;close ();&lt;BR /&gt;    }&lt;BR /&gt;close STDOUT;&lt;BR /&gt;--&amp;gt;8---&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn&lt;/COLUMN-WIDTH&gt;&lt;/DATE-FORMAT&gt;&lt;/SEP&gt;&lt;/SEP&gt;&lt;/COLUMN-WIDTH&gt;&lt;/DATE-FORMAT&gt;&lt;/SEP&gt;&lt;/SEP&gt;</description>
      <pubDate>Sat, 09 Apr 2005 14:15:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517800#M219348</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2005-04-09T14:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting csv file to binary</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517801#M219349</link>
      <description>Hi Merijn,&lt;BR /&gt;&lt;BR /&gt;  Many thanks for the script. I am in the midst of digesting - quite a big for my level. &lt;BR /&gt;&lt;BR /&gt;  One last thing I would like to know is whether converting binary to text is possible? if so can I used CSV_XS to achieve this? &lt;BR /&gt;&lt;BR /&gt;  I am terribly sorry for constant queries. Thanks for your invaluable assistance.&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Henry</description>
      <pubDate>Mon, 11 Apr 2005 03:42:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517801#M219349</guid>
      <dc:creator>Henry Chua</dc:creator>
      <dc:date>2005-04-11T03:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting csv file to binary</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517802#M219350</link>
      <description>Binary to text is to vague a goal to solve.&lt;BR /&gt;&lt;BR /&gt;Do you consider UTF8 binary? Or Unicode? Or even iso-8859-1?&lt;BR /&gt;&lt;BR /&gt;If your defenition of "Text" is plain US-ASCII 7 bit, yes, it's probably possible, most likely possible even. But your conversion will not be lossless&lt;BR /&gt;&lt;BR /&gt;What is "Binary" and what is "Text". That is the crucial question in your quest. Once you can answer that unambigouously, my answer would probably be "yes"&lt;BR /&gt;&lt;BR /&gt;If your def of Binary is "fixed width records" that should be converted to html or other text based data files, do&lt;BR /&gt;&lt;BR /&gt;# man perlpacktut&lt;BR /&gt;&lt;BR /&gt;and teach yourself unpack&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Mon, 11 Apr 2005 03:55:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517802#M219350</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2005-04-11T03:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting csv file to binary</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517803#M219351</link>
      <description>Hi Merijn,&lt;BR /&gt;&lt;BR /&gt;  From a look at a binary file is it possible to tell which coding it is using? For example the binary file I provided in the begining of the query, can you tell which format is it using?&lt;BR /&gt;&lt;BR /&gt;  And many thanks, You have been really been a great help, sorry if my question look weird to u..&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Henry</description>
      <pubDate>Tue, 12 Apr 2005 08:55:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517803#M219351</guid>
      <dc:creator>Henry Chua</dc:creator>
      <dc:date>2005-04-12T08:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting csv file to binary</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517804#M219352</link>
      <description>Your .null file is a LIF file, which is pretty much a binary format :)&lt;BR /&gt;&lt;BR /&gt;a5:/tmp 102 &amp;gt; file *.null&lt;BR /&gt;226232.null:    lif file&lt;BR /&gt;a5:/tmp 103 &amp;gt; lifls *.null | head&lt;BR /&gt;WS_FILE&lt;BR /&gt;&lt;BR /&gt;a5:/tmp 104 &amp;gt;&lt;BR /&gt;&lt;BR /&gt;There are several LIF commands:&lt;BR /&gt;&lt;BR /&gt;lifcp, lifinit, lifls, lifrename, and lifrm&lt;BR /&gt;&lt;BR /&gt;a5:/tmp 108 &amp;gt; lifls -l *null&lt;BR /&gt;volume HFSLIF data size 1052 directory size 1&lt;BR /&gt;filename   type   start   size     implement  created&lt;BR /&gt;===============================================================&lt;BR /&gt;WS_FILE    -5791  2       121      20200080   00/00/00 00:00:00&lt;BR /&gt;a5:/tmp 109 &amp;gt;&lt;BR /&gt;&lt;BR /&gt;Now, maybe, you might mean that you want to know the format of WS_FILE&lt;BR /&gt;&lt;BR /&gt;a5:/tmp 110 &amp;gt; lifcp 226232.null:WS_FILE .&lt;BR /&gt;a5:/tmp 111 &amp;gt; file WS_FILE&lt;BR /&gt;WS_FILE:        data&lt;BR /&gt;a5:/tmp 112 &amp;gt;&lt;BR /&gt;&lt;BR /&gt;Looking at the hex-dump of WS_FILE, it looks very parsable and very binary (about Volt, Ampere, and Ohm). Since I have no idea what it is, I cannot give you any guidelines here&lt;BR /&gt;&lt;BR /&gt;00000100  00 00 00 06 52 36 39 34  30 32 00 00 00 06 52 36    ....R69402....R6&lt;BR /&gt;00000110  39 34 30 32 00 00 00 07  53 55 42 53 49 54 45 20    9402....SUBSITE&lt;BR /&gt;00000120  00 00 00 07 53 55 42 53  49 54 45 20 00 00 00 08    ....SUBSITE ....&lt;BR /&gt;00000130  4E 56 74 68 69 28 31 29  00 00 00 07 4E 49 64 73    NVthi(1)....NIds&lt;BR /&gt;00000140  28 31 29 20 00 00 00 08  4E 56 74 68 69 28 32 29    (1) ....NVthi(2)&lt;BR /&gt;00000150  00 00 00 08 4E 49 6F 66  66 28 32 29 00 00 00 07    ....NIoff(2)....&lt;BR /&gt;&lt;BR /&gt;00000890  00 00 00 00 00 03 49 44  53 20 00 00 00 07 53 55    ......IDS ....SU&lt;BR /&gt;000008A0  42 53 49 54 45 20 00 00  00 04 56 54 48 46 00 00    BSITE ....VTHF..&lt;BR /&gt;000008B0  00 03 49 44 53 20 00 00  00 04 56 54 48 46 00 00    ..IDS ....VTHF..&lt;BR /&gt;000008C0  00 06 49 44 53 4F 46 46  00 00 00 03 49 44 53 20    ..IDSOFF....IDS&lt;BR /&gt;000008D0  00 00 00 05 42 56 44 53  53 20 00 00 00 08 56 54    ....BVDSS ....VT&lt;BR /&gt;000008E0  48 4C 43 44 32 46 00 00  00 03 49 44 53 20 00 00    HLCD2F....IDS ..&lt;BR /&gt;000008F0  00 08 56 54 48 4C 43 44  32 46 00 00 00 06 49 44    ..VTHLCD2F....ID&lt;BR /&gt;&lt;BR /&gt;00000EC0  00 00 00 00 00 00 00 00  00 01 41 20 00 00 00 01    ..........A ....&lt;BR /&gt;00000ED0  41 20 00 00 00 01 56 20  00 00 00 01 41 20 00 00    A ....V ....A ..&lt;BR /&gt;00000EE0  00 01 56 20 00 00 00 01  41 20 00 00 00 01 41 20    ..V ....A ....A&lt;BR /&gt;00000EF0  00 00 00 01 56 20 00 00  00 01 56 20 00 00 00 01    ....V ....V ....&lt;BR /&gt;00000F00  41 20 00 00 00 01 56 20  00 00 00 01 41 20 00 00    A ....V ....A ..&lt;BR /&gt;00000F10  00 01 41 20 00 00 00 01  41 20 00 00 00 01 56 20    ..A ....A ....V&lt;BR /&gt;00000F20  00 00 00 01 56 20 00 00  00 01 41 20 00 00 00 01    ....V ....A ....&lt;BR /&gt;00000F30  41 20 00 00 00 01 41 20  00 00 00 01 56 20 00 00    A ....A ....V ..&lt;BR /&gt;00000F40  00 01 56 20 00 00 00 01  41 20 00 00 00 01 56 20    ..V ....A ....V&lt;BR /&gt;00000F50  00 00 00 01 56 20 00 00  00 06 4F 68 6D 2F 5B 5D    ....V ....Ohm/[]&lt;BR /&gt;00000F60  00 00 00 06 4F 68 6D 2F  5B 5D 00 00 00 06 4F 68    ....Ohm/[]....Oh&lt;BR /&gt;00000F70  6D 2F 5B 5D 00 00 00 01  41 20 00 00 00 01 56 20    m/[]....A ....V&lt;BR /&gt;&lt;BR /&gt;000016A0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00    ................&lt;BR /&gt;000016B0  00 01 33 20 00 00 00 01  32 20 00 00 00 01 34 20    ..3 ....2 ....4&lt;BR /&gt;000016C0  00 00 00 01 31 20 00 00  00 00 00 00 00 00 00 00    ....1 ..........&lt;BR /&gt;000016D0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00    ................&lt;BR /&gt;000016E0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00    ................&lt;BR /&gt;000016F0  00 00 00 00 00 00 00 00  00 01 33 20 00 00 00 01    ..........3 ....&lt;BR /&gt;00001700  32 20 00 00 00 01 34 20  00 00 00 01 31 20 00 00    2 ....4 ....1 ..&lt;BR /&gt;00001710  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00    ................&lt;BR /&gt;00001720  00 01 33 20 00 00 00 01  32 20 00 00 00 01 34 20    ..3 ....2 ....4&lt;BR /&gt;00001730  00 00 00 01 31 20 00 00  00 00 00 00 00 00 00 00    ....1 ..........&lt;BR /&gt;00001740  00 00 00 00 00 00 00 00  00 01 35 20 00 00 00 01    ..........5 ....&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Tue, 12 Apr 2005 09:31:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/3517804#M219352</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2005-04-12T09:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting csv file to binary</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/7031589#M491107</link>
      <description>&lt;P&gt;What converter or code did you use to achieve this?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Jan 2019 05:11:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/coverting-csv-file-to-binary/m-p/7031589#M491107</guid>
      <dc:creator>samsonic221</dc:creator>
      <dc:date>2019-01-18T05:11:21Z</dc:date>
    </item>
  </channel>
</rss>

