LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 10-17-2007, 12:51 AM   #1
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Rep: Reputation: 46
awk: associative array key names


Hello.
Is there a way to get the keys of associative arrays in awk?
For eg: something like TCL's equivalent of [array names foo]?
Thanks.
 
Old 10-17-2007, 12:55 AM   #2
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
if i get you correctly

Code:
for (keys in array) print keys
or else, post a sample.
 
Old 10-17-2007, 12:58 AM   #3
h/w
Senior Member
 
Registered: Mar 2003
Location: New York, NY
Distribution: Debian Testing
Posts: 1,286

Original Poster
Rep: Reputation: 46
That's precisely what I'm looking for.
Cool, thanks.
 
  


Reply



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
Changing Meta-key names in KDE Captain Tram Linux - Desktop 0 08-23-2006 01:43 PM
Perl: find array key by value bulliver Programming 2 04-06-2006 03:01 PM
exchange value and key per element in associative array rblampain Programming 3 04-02-2006 09:07 AM
using associative arrays corbis_demon Programming 0 01-25-2005 12:47 AM
How to return values into an array using awk Helene Programming 1 05-01-2004 10:05 PM

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

All times are GMT -5. The time now is 07:18 PM.

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