Re: writing to file

2007-06-23 Thread Yogesh Sawant
Vahid wrote: > Hi all, > I have the following code to sort UNIX's password file, it works fine > but can only display on stdout. How can I make it write the output to > a file? > Thanks, > > #!/bin/perl -w > # > use strict; > open(myFILE, '|-','awk','-F:','s[$1]++==0' ) or die $!; > open(passwdFH,

Re: Writing to file

2004-02-01 Thread R. Joseph Newton
Support wrote: > Hi all > I have a little bit of code you may be able to help with. > I load a file into an array with > > foreach $lines(@database_array) { >@edit_array = split(/\:/,$lines); >push(@member_array,[EMAIL PROTECTED]); >$x++; > } #loop > > and then play around with the a

Re: Writing to file

2004-02-01 Thread John W. Krahn
Support wrote: > > Hi all Hello, > I have a little bit of code you may be able to help with. I load a > file into an array with > > foreach $lines(@database_array) { You should limit the scope of $lines to the foreach loop. Does $lines contain multiple lines or just one line? Perhaps you sho

Re: Writing to file

2004-02-01 Thread Jeff 'japhy' Pinyan
On Feb 2, Support said: >foreach $lines(@database_array) { > @edit_array = split(/\:/,$lines); > push(@member_array,[EMAIL PROTECTED]); > $x++; >} #loop First, it doesn't look like you're using 'strict', which means you're not declaring your variables. This is probably going to lead to trou

RE: Writing to file

2004-02-01 Thread Hanson, Rob
> but I can not retrieve the data into $newline with join. Is this bit wrong Yes, it is a little off. > $member_array[$count] This *isn't* an array, it is an *array reference* > [EMAIL PROTECTED] Same with this. Join takes a list of scalars, not a list of references. So you need to dereferen

Re: writing to file

2003-07-22 Thread denis
I stand corrected.. It should be ">" not ">>".. Should stop reading the list late at night.. Thanks On Tue, 22 Jul 2003 [EMAIL PROTECTED] wrote: > > On Mon, 21 Jul 2003 21:55:03 -0600 (MDT), [EMAIL PROTECTED] wrote: > > > open the file with ">>

Re: writing to file

2003-07-22 Thread wiggins
On Mon, 21 Jul 2003 21:55:03 -0600 (MDT), [EMAIL PROTECTED] wrote: > open the file with ">>" > This will cause an overwrite.. > Actually that is an "append". Maybe there is a definition issue, aka I would think of an "overwrite" to be a ">" where

Re: writing to file

2003-07-21 Thread denis
open the file with ">>" This will cause an overwrite.. On Mon, 21 Jul 2003, awarsd wrote: > Hi, > > I'm curious to know if it is possible to write to file with overwritting > information without putting into an array > if i have in a file > a > b > c > d > e > and i want to add g-r-t-u-x i wou

RE: writing to file

2003-07-21 Thread Charles K. Clarkson
awarsd <[EMAIL PROTECTED]> wrote: : : I'm curious to know if it is possible to write : to file with overwritting information without : putting into an array if i have in a file : : a : b : c : d : e : and i want to add g-r-t-u-x i would get : now in the file : : g : r : t : u : x : e <-- stays the

Re: Writing to file not working......

2001-08-09 Thread Michael Fowler
On Thu, Aug 09, 2001 at 06:53:15PM -0500, CDitty wrote: > The email.txt file is an empty file and has the correct permissions. You're reading from a file, expecting data to be there, but the file is empty. Could this be your problem? > # This section needs to cycle through the emails.txt file