Skip to content

Instantly share code, notes, and snippets.

@kunst1080
Created April 10, 2014 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunst1080/10385759 to your computer and use it in GitHub Desktop.
Save kunst1080/10385759 to your computer and use it in GitHub Desktop.
Unix command line utilities for fixed length file - fixed file to csv by perl unpack template
#!/usr/bin/perl
while(defined($_ = <STDIN>)) {
chomp $_;
my $template = $ARGV[0];
my @o=unpack("$template", $_);
print join(",",@o) . "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment