>-----Original Message----- >From: Parag Kalra [mailto:paragka...@gmail.com] >Sent: Wednesday, January 05, 2011 12:13 >To: Wagner, David --- Senior Programmer Analyst --- CFS >Cc: Perl Beginners >Subject: Re: Getting LineFeed for Excel within q quoted field > >It may have to do something how you are opening the file handler of CSV >file. > >The data you seen in the csv file may depend on which encoding you >have used while creating the file. > >Couple of questions: > >1. I believe currently you are view the file on Windoze, when you view >the file on Unix, do you still see the graphics.
[Wags] I am viewing with Scite and also a Hex editor. But even when I am doing the change using s/\^/\x0a/g I am seeing in the file itself as 0d0a and not just the 0a. Obviously I am missing something very basic at this point. Excel is expecting a 0a indicating a soft return, and I have verified I am using the right code, but comes out incorrectly. What am I missing?? Thanks much for any insight.. Wags ;) David R. Wagner Senior Programmer Analyst FedEx Services 1.719.484.2097 Tel 1.719.484.2419 Fax 1.408.623.5963 Cell http://Fedex.com/us >2. Is graphics visible on most of the editors or have you used only 1 >editor? > >Cheers, >Parag > > > > >On Tue, Jan 4, 2011 at 3:56 PM, Wagner, David --- Senior Programmer >Analyst --- CFS <david.wag...@fedex.com> wrote: >> I am generating an CSV and want a couple of fields to have soft >> returns in them. I went into Excel and added a couple of soft returns to >> a couple of different fields and then saved the modified file back to a >> CSV. >> I opened in a editor and reviewed what was there. What I saw >> was: >> "xxxxxxxxxxx(lf) # shows as LF verses the std end of line for >> windows of CR/LF >> Yyyyyyyyyyyy(lf) >> " >> >> I left the editor and double clicked again and brought into >> Excel. The data had the soft returns. >> >> So I added the following to my processing: >> >> for ( @MyWorka ) { >> if ( /\^/ ) { >> s/\^/\x0a/g; # I have tried the \r and even >> \n and when opened in >> # Excel always has the >> graphic explained below.... >> } >> } >> >> Whereever there is a ^ replace with a hex A which to me is a >> LineFeed ( incorrectly as I have read ). I run and create my csv. I >> double click the file and it opens in Excel. It appears to be working, >> but where each linefeed is you get a little graphic with a question mark >> inside a circle. In a way it is doing the soft returns, but obviously >> not correctly. >> >> Any thoughts on what I am doing incorrectly?? >> >> Thanks. >> >> Wags ;) >> David R. Wagner >> Senior Programmer Analyst >> FedEx Services >> 1.719.484.2097 Tel >> 1.719.484.2419 Fax >> 1.408.623.5963 Cell >> http://Fedex.com/us >> >> >> >> -- >> To unsubscribe, e-mail: beginners-unsubscr...@perl.org >> For additional commands, e-mail: beginners-h...@perl.org >> http://learn.perl.org/ >> >> >>