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 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]