#!/usr/bin/perl -w use strict; { my $input =$ARGV[0]; #returns filename from command line my $nodename; my $filename; my $pathname; my $backupdate; my $textline; my $nochar =""; my $charposition; my $nextrecord; chomp $input; #strip the carriage return open (DATAFILE, "$input")|| die ("Can not open $input:!\n"); #access the file while (my $textline=) { chomp $textline; foreach my $textline { next if ($textline =~ /($charposition = m/({0}/)!= $nochar; else { $nodename = m/({0,9}/; $filename = m/({10,19}/; $pathname = m/({20,29}/; $backupdate = m/({30).*/; printf ("%s%s%s%s\n",$nodename, $filename, $backupdate, $pathname); } } close (DATAFILE); }