Sponsored Content
Top Forums Shell Programming and Scripting Outputting Results to Indexed List Post 302914906 by sudo on Thursday 28th of August 2014 05:24:04 PM
Old 08-28-2014
Outputting Results to Indexed List

I'm looking for some suggestions on a command line utility I am making. I would like to use 'find' to locate some files and index the results so the user can choose the correct results from the list and push that input into an open command. A simple example below:
Code:
/Users/admin/Desktop/misc/Untitled 4.txt
/Users/admin/Desktop/misc/Untitled.txt
/Users/admin/Desktop/output 2.txt
/Users/admin/Desktop/output.txt
/Users/admin/Desktop/testr.txt

My intention is to build an interface that shows the index on each line and the end user can choose the index number, like so:

Code:
[0]/Users/admin/Desktop/misc/Untitled 4.txt
[1]/Users/admin/Desktop/misc/Untitled.txt
[2]/Users/admin/Desktop/output 2.txt
[3]/Users/admin/Desktop/output.txt
[4]/Users/admin/Desktop/testr.txt

Any thoughts?
Thanks!

OSX10.9
 

10 More Discussions You Might Find Interesting

1. Programming

indexed sequential access in c files

hi, I want to implement indexed sequential access method in my flat file, Any idea other than INFORMIX C-ISAM library, because it is not free ware, Any Freeware available? (0 Replies)
Discussion started by: vrkiruba
0 Replies

2. UNIX for Dummies Questions & Answers

List grep results

Hi I need to search for matching strings in a database and I want to print out all files that matches in "detail", which means that I want the output to contain datum of last saving. I only get the grep function tp print the actual file names which is not enough since the database is to large... (14 Replies)
Discussion started by: slire
14 Replies

3. Shell Programming and Scripting

filtering list results

I created a large file list using: find . -type f -mtime +540 > test2.txt ..which searched recursively down the directory tree searching for any file older than 540 days. I would like to filter the results removing the directory name and the "/" character, resulting in only a list of the... (3 Replies)
Discussion started by: fxvisions
3 Replies

4. Shell Programming and Scripting

outputting data in table from grep results

Hi all. I'm a real unix newbie and looking for some help on a shell scripting problem. I'm going the longest ways around everything but I'm getting there. My next problem however has me stumped. I have set up a program that takes inputs from a user for a particular month and year (and stores them... (2 Replies)
Discussion started by: Chillspark
2 Replies

5. UNIX for Dummies Questions & Answers

getting input, then outputting it

Hi! I am a newbie to Unix. I was writing a little game program for fun when thought of an idea to allow data to be saved. I knew to take all of the Predefined variables and put them into a separate file, then including the file in the program. But I am having trouble making it so that the user... (0 Replies)
Discussion started by: signebedi
0 Replies

6. Shell Programming and Scripting

How to extract data from indexed files (ISAM files) maintained in an unix server.

Hi, Could someone please assist on a quick way of How to extract data from indexed files (ISAM files) maintained in an UNIX(AIX) server.The file data needs to be extracted in flat text file or CSV or excel format . Usually we have programs in microfocus COBOL to extract data, but would like... (2 Replies)
Discussion started by: devina
2 Replies

7. Shell Programming and Scripting

Multiple indexed conditions with ksh

Dear Unix Experts, I have randomly generated the x, y, and z coordinates of 16 atoms of two species, A and B (8 atoms each) Then I calculated the spacing between all the A atoms labeled d1, B atoms labeled d2 and between A and B atoms labeled d3. I would like to save the x, y, z coordinates to... (1 Reply)
Discussion started by: vahid
1 Replies

8. Shell Programming and Scripting

Can ctag and cscope support recording search results and displaying the history results ?

Hello , When using vim, can ctag and cscope support recording search results and displaying the history results ? Once I jump to one tag, I can use :tnext to jump to next tag, but how can I display the preview search result? (0 Replies)
Discussion started by: 915086731
0 Replies

9. Shell Programming and Scripting

Replace string in a file with some content indexed from another file.

We have two files file 1: (usually small, ~100 lines), each line contains a : separated index, value e.g 2: Apple 1: Banana 5: Pear 7: Orange File 2: (usually large, 10 million lines or more), each line contains a single string value. e.g xyz1 xyz2 xyz3 xyz4 xyz5 xyz6 xyz7 Now... (2 Replies)
Discussion started by: AlokKumbhare
2 Replies

10. Shell Programming and Scripting

Search for names in one list in another and print results

Hi All , New to the Bash / Shell programming world and looking for some help I have two files 1: Contains a list of names : eg STEVE BOB CRAIG 2: Contains information with those included names but also others that are not in the list (1 Reply)
Discussion started by: Lonerg550
1 Replies
Query Results(3)						 globus rls client						  Query Results(3)

NAME
Query Results - Data Structures struct globus_rls_attribute_object_t globus_rls_client_lrc_attr_search() returns a list of these structures which include the object name (LFN or PFN) and attribute value found by the query. struct globus_rls_string2_t String pair result. struct globus_rls_string2_bulk_t String pair result with return code, returned by bulk query operations. Functions globus_result_t globus_rls_client_free_list (globus_list_t *list) Detailed Description List results are returned as globus_list_t's, list datums depend on the type of query (eg globus_rls_string2_t, globus_rls_attribute_t, etc). A list result should be freed with globus_rls_client_free_list() when it's no longer needed. RLS supports limiting the number of results returned by a single query using an offset and reslimit. The offset specifies which result to begin with, reslimit specifies how many results to return. Offset should begin at 0 to retrieve all records. If reslimit is 0 then all results are returned at once, unless the server has a limit on results configured. If NULL is passed as the offset argument then the API will repeatedly call the query function until are results are retrieved. The following are equivalent examples of how to print the lfn,pfn pairs returned by globus_rls_client_lrc_get_lfn(): globus_list_t *str2_list; globus_list_t *p; globus_rls_string2_t *str2; // Retrieve all results, API will handle looping through partial results // if the server has a limit configured. Error handling has been omitted. globus_rls_client_lrc_get_lfn(h, "somepfn", NULL, 0, &str2_list); for (p = str2_list; p; p = globus_list_rest(p)) { str2 = (globus_rls_string2_t *) globus_list_first(p); printf("lfn: %s pfn:%s0, str2->s1, str2->s2); } globus_rls_client_free_list(str2_list); // This code fragment retrieves results 5 at a time. Note offset is set // to -1 when the server has no more results to return. int offset = 0; while (globus_rls_client_lrc_get_lfn(h, "somepfn", &offset, 5, &str2_list) == GLOBUS_SUCCESS) { for (p = str2_list; p; p = globus_list_rest(p)) { str2 = (globus_rls_string2_t *) globus_list_first(p); printf("lfn: %s pfn:%s0, str2->s1, str2->s2); } globus_rls_client_free_list(str2_list); if (offset == -1) break; } .fi Function Documentation globus_result_t globus_rls_client_free_list (globus_list_t *list) Free result list returned by one of the query functions. Parameters: list List returned by one of the query functions. Return values: GLOBUS_SUCCESS List and contents successfully freed. Author Generated automatically by Doxygen for globus rls client from the source code. Version 5.2 Wed Jan 25 2012 Query Results(3)
All times are GMT -4. The time now is 08:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy