Skip to content

Unclassified: Perl Script to Pad length of data file SEC=UNCLASSIFIED

July 2, 2009

#!/bin/perl

open(INFILE, "<g:\Insert_Filename.TXT") or die "Can’t open input.txt: $!";

open(OUTFILE, ">g:\Insert_Filename2.TXT") or die "Can’t open output.txt: $!";

$line = <INFILE>;

while ($line ne "") {

$pad = <UPDATE with length 154 > – length ($line);

chomp $line;

$new_line = $line.(" "x$pad);

print OUTFILE "$new_linen";

$line = <INFILE>;

}

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: