LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 07-05-2006, 09:02 AM   #1
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
[tcl]split


Code:
OK BVN060705FLN1625 2006/07/05 16:25:00 {eng, "Hondjes", "Een leuk langharig hondengezin, bestaande uit 3 puppies en hun ouders, hebben hun huis en baas ingeruild voor het vrije leven en komen terecht op een rangeerterrein in een grote stad. Daar beleven ze vele spannende avonturen.", "Kinderprogramma", E} 1099
The above is a list generated in tcl. The 5th element (lindex $variable 4) needs to be split into its 5 subelements.
I'm a bit stuck as it can't be split on comma as the subelements can contain commas as well; similar for space. Is there an intelligent tcl-way or do I have to analyze the line (basically char by char)?
 
Old 07-05-2006, 09:07 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Original Poster
Rep: Reputation: 282Reputation: 282Reputation: 282
And of course, the bell rang a few minutes later Replace <space><doublequote> by a <space><curly> and <doublequote><comma> by <curly><space>
Code:
set epg [string map {\", \}\  \ \" \ \{} [lindex $record 4]]

Last edited by Wim Sturkenboom; 07-05-2006 at 09:11 AM.
 
  


Reply

Tags
split, tcl


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tcl/tk pxumsgdxpcvjm Linux - Newbie 2 03-04-2006 07:01 PM
tcl/tk: vinaysg Programming 8 02-17-2006 06:52 AM
Tcl/Tk 8.4.7 dakota rob Solaris / OpenSolaris 3 10-27-2004 02:51 PM
Tcl/tk ccarrieta28 Linux - Software 0 09-10-2003 02:49 PM
About TCL? JIV Programming 2 05-02-2003 03:27 AM


All times are GMT -5. The time now is 05:38 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration