ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> activetcl
activetcl
Re: [Activetcl] split doing two different things
by Michael Bahr other posts by this author
Apr 8 2008 10:53AM messages near this date
view in the new Beta List Site
Re: [Activetcl] split doing two different things | Re: [Activetcl] split doing two different things
>  > programming in Perl for over 13 years and use it as a standard for 
>  > these things.  Perl's split returns 8 strings as expected as above.
>  
>  That is a grave mistake on so many levels ;).

Oh, I do not know.  I find some of Tcl's constructs a bit quirky so I do
my testing in Perl first because I can do it lickedy-split.  ;O

>  > So can someone please explain why Tcl's split "sees" an 
>  empty string 
>  > at the end of the line?  I do not think this is normal behavior.
>  
>  Indeed, as Jeff noted, how do you tell the difference between:
>  
>  	split a,b,c, ","
>  and	split a,b,c  ","
>  
>  This is a very important distinction, one that Tcl won't trip 
>  you up over.  You can actually get Perl to do the same, it's 
>  just the default will strip trailing empties.
>  

I see these two strings as the same because I **see** a carriage return
immediately after the comma (delimiter).   This indicates to me that
there **may be** another field but there is not.  If both of these
strings above were imported into an app like Excel or one that reads a
csv file the displayed results would be the same.  The app **may** put a
null into the next field if it sees a delimiter with nothing after it.
Being at the end of the line it does not make any difference.

>  Jeff
>  

Mike...
_______________________________________________
ActiveTcl mailing list
ActiveTcl@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Gene Osteen
Jeff Hobbs
Flavio Salgueiro
Michael Bahr
Jeff Hobbs
Michael Bahr
Dossy Shiobara
Michael Bahr
Dossy Shiobara
Michael Bahr
Jeff Hobbs
Enrico Herzke
Michael Bahr
Jeff Dinsmore
Michael Bahr
Gene Osteen
Jeff Dinsmore
Enrico Herzke

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved