Cool. I think I have an idea - what is your question?
tim
-Original Message-
From: Anand, Pankaj [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 30, 2002 2:18 PM
To: 'Beginners (E-mail)
Subject: change the format of file.
Hi ,
I want to make a perl script which can take the input fr
Hi,
Try this (modifing up as you please):
open (INPUT, "input.txt" ) or die "Can't open: $!";
open (OUTPUT, "output.txt") or die "Can't open: $!";
my %data;
my $state = 0;
while () {
chomp;
$data{$state++} = $_ if $state == 0;
$data{$state++} = $_ if $state == 1;
$data{$state+
Here is a display portion of what you want to do:
#!perl -w
while ( ) {
chomp;
printf "definition1 %s\ndefinition2\ndefinition3\ndefinition4:%s\n", $_, $_;
}
__DATA__
name1
name2
^-- Script ends here
Output:
definition1 name1
definition2
definition3
definition4: