Hi Marc, Any chance of seeing some code/data?
If you're chomping the input, and as output you have print $prefix,$data,"\n"; or print "$prefix$data\n"; then something must be happening to your $prefix value; either that, or maybe you've got another print statement somewhere. Maybe if your "\n" is in a string, something's getting appended to the string. Whichever t is, I can't help without seeing your code. BTW, allways CC follow-ups back to the list so other people can help. Gary On Friday 07 February 2003 11:02 pm, Fromm, Marc wrote: > I tried the chomp and it produced: > string item1 > string item2 > string item3 > > It got rid of the spaces between itmes, but notice the incremental > indention. > > Marc > > Marc Fromm > Computer Systems Specialist > University of Montana--Western > 710 South Atlantic Street > Dillon, MT 59725 > 406-683-7164 > > > > > ---------- Original Message ---------------------------------- > From: Gary Stainburn <[EMAIL PROTECTED]> > Date: Fri, 7 Feb 2003 09:00:23 +0000 > > >On Friday 07 Feb 2003 5:04 am, Fromm, Marc wrote: > >> Hi > >> > >> I created a script that reads a file and attaches a string infront of > >> each read in item. When the file is saved with the changes though, each > >> item has a blank line between the next item. The original text document > >> does is single sapced. > >> > >> Original tesxt file > >> item1 > >> item2 > >> item3 > >> > >> Saved text file > >> string item1 > >> > >> string item2 > >> > >> string item3 > >> > >> I think what his happening is when the items are read in lots of white > >> space is attached to the end of the string. > >> > >> Is there a way to remove only trailing white space, from a string, but > >> retain white spaces with in the string? thanks, > > > >Hi Marc, > > > >Unless you're doing something peculiar, nothing will be added to the > > string as you read it in. However, it will contain the EOL character - > > on DOS it's CRLF, on unix it's LF and on mac's it CR. > > > >If you're then adding the EOL when you're printing it, then that's your > >problem. Either chomp the input or don't add a new one on output. > > > >If this doesn't help, try posting the code in question so we can have a > > look. > > > >HTH > > > >Gary > > > >> Marc > >> > >> Marc Fromm > >> Computer Systems Specialist > >> University of Montana--Western > >> 710 South Atlantic Street > >> Dillon, MT 59725 > >> 406-683-7164 > >> > >> > >> > >> ________________________________________________________________ > >> Sent via the HotDawg Mail system at hotdawg.umwestern.edu > > > >-- > >Gary Stainburn > > > >This email does not contain private or confidential material as it > >may be snooped on by interested government parties for unknown > >and undisclosed purposes - Regulation of Investigatory Powers Act, 2000 > > > >--- > >[This E-mail scanned for viruses by Declude Virus] > > ________________________________________________________________ > Sent via the HotDawg Mail system at hotdawg.umwestern.edu -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purposes - Regulation of Investigatory Powers Act, 2000 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]