LinuxQuestions.org
Visit Jeremy's Blog.
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-22-2010, 06:34 AM   #1
technononsense
LQ Newbie
 
Registered: Jul 2008
Posts: 6

Rep: Reputation: 0
zenity editable list help


I'm trying to use zenity in a bash script to display a .csv file using '--list' to allow the user to edit some of the values.

I can display it fine but i'm unsure how to edit the data? all i can get is whichever line is highlited when hitting ok on the zenity dialog to print.

the data in the csv is arranged:
<prod>,<disc>,<qty>,<type>,<location>

Can anyone point me in the right direction?
 
Old 07-22-2010, 08:36 PM   #2
tonyfreeman
Member
 
Registered: Sep 2003
Location: Fort worth, TX
Distribution: Debian testing 64bit at home, EL5 32/64bit at work.
Posts: 196

Rep: Reputation: 30
You need to use the '--print-column=ALL' option in order to print out the entire line you made edits to.

I suggest adding a hidden column that will act as a key and using the --seperator=, because you are using a CSV file.

Your user cannot edit the key, so that way when you get the output on the command line, you can use that key as a common denominator with your CSV file to replace values.

Example:

Code:
zenity --list --editable --print-column=ALL --hide-column=1 --separator=, --column=key --column=prod --column=disc --column=qty --column=type --column=location 000 a ca ca ac ca 001 b cb cb cb cb 002 c cc cc cc cc
I do my edits by adding a bunch of z's to the b (or 001) row and click the OK button to get this:

Code:
001,bzzzz,cbzzzz,cbzzz,cbzzz,cbzzz
You can then use the 001 to search your CSV and replace the values.
 
  


Reply


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
Dymically determing the number of check list in Zenity, How? shivarajM Linux - Software 5 04-30-2009 06:57 AM
recommendation for editable file jukebox55 Linux - Software 2 08-10-2007 05:03 PM
Editable input from the terminal and redirection neville310 Programming 4 04-10-2007 03:24 AM
KMenu not updating/editable joosep MEPIS 4 06-29-2005 06:35 PM
passwd not Editable sunil_thaha Linux - Newbie 4 01-17-2005 01:04 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:45 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration