Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Appending lines from an existing list to each line in another existing list Post 302554191 by radoulov on Saturday 10th of September 2011 04:06:51 PM
Old 09-10-2011
Well,
I don't see a better approach right now.
The code builds and associative array in memory with the content of list2, then it simply prints that list for every line in list1: it runs nested loops.

Last edited by radoulov; 09-11-2011 at 04:21 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Add Multiple Lines in an existing file

Hi Unix Experts, I like to add the following multiple lines in an existing file: CHANNELS: MaxChannels=600 MaxActiveChannels=600 MaxInitiators=22 I would be highly appreciated if somebody can shed some light on it. Thank you in advance!!! Khan (5 Replies)
Discussion started by: hkhan12
5 Replies

2. Shell Programming and Scripting

folder existing and file existing

I want to look into a folder to see if there are any folders within it. If there are, I need to check inside each folder to see if it contains a .pdf file So If /myserver/myfolder/ contains a folder AND that folder conatins a .pdf file do X Else do Z I may have multiple folders and... (4 Replies)
Discussion started by: crowman
4 Replies

3. Shell Programming and Scripting

how to insert text between lines of an existing file using perl

Hi , I need some inputs on how to open a file (file.txt) and parse the text example aaa of the file and bbb of the file and add the text zzzz once i parse (aaa and bbb) and followed by the remaining of the text as it is in the file using perl programming. Thanks in advance (3 Replies)
Discussion started by: madhul2002
3 Replies

4. Solaris

Add existing user into an existing group

Pre: no gpasswd/adduser there is just usermod can be used, also there is no -a option for usermod. How should I add a user into a group? (4 Replies)
Discussion started by: a2156z
4 Replies

5. Shell Programming and Scripting

insert pipes for existing and non-existing records

I have a source file like this, L4058S462 34329094 F51010141TK1070000483L4058S462 34329094 0232384840 381892 182 5690 L4058S462 34329094 F51020141FIRST CLEARING, LLC A/C 3432-9094 L4058S462 34329094 F51030141JOHAN HOLMQVIST ... (1 Reply)
Discussion started by: saravanamr
1 Replies

6. Shell Programming and Scripting

Appending a CPIO to an existing archive

I created a CPIO archive I wanted to add addition data to it but am having issues: -rw-r--r-- 1 test test 629295104 2011-10-28 12:41 /home/test/Downloads/test.cpio I tried: sudo find /tmp -depth | cpio -oAO /home/test/Downloads/test.cpio cpio: premature end of file and (1 Reply)
Discussion started by: metallica1973
1 Replies

7. Shell Programming and Scripting

Append to existing line

I have a file which has lines that end with a plus (+) sign. I would like to get the next line appended to the one with the plus. For example bla bla bla bla bla + blip blip blip would become bla bla bla bla bla blip blip blip However not all lines end with a plus sign . I would... (2 Replies)
Discussion started by: bombcan
2 Replies

8. Shell Programming and Scripting

Appending new column to existing files

Hi, i want to add another column to existing files containing strings and need to have the final output as a csv file. i have quite a number of files, each with varying number of rows and i need to append the string "test" for all the valid rows for each file. my sample raw files looks like this... (8 Replies)
Discussion started by: ida1215
8 Replies

9. Shell Programming and Scripting

Build a table from a list by comparing existing table entries

I am new to this shell scripting.... I have a file which contains list of users. This files get updated when new user comes into the system. I want to create script which will give a table containing unique list of users. When I say unique, it means script should match table while parsing... (3 Replies)
Discussion started by: dchavan1901
3 Replies

10. Shell Programming and Scripting

Finding non-existing words in a list of files in a directory and its sub-directories

Hi All, I have a list of words (these are actually a list of database table names separated by comma). Now, I want to find only the non-existing list of words in the *.java files of current directory and/or its sub-directories. Sample list of words:... (8 Replies)
Discussion started by: Bhanu Dhulipudi
8 Replies
libtar_list_new(3)						  C Library Calls						libtar_list_new(3)

NAME
libtar_list_new, libtar_list_free, libtar_list_next, libtar_list_prev, libtar_list_add, libtar_list_del, libtar_list_search, lib- tar_list_dup, libtar_list_merge, libtar_list_add_str - linked list routines SYNOPSIS
#include <libtar.h> libtar_list_t *libtar_list_new(int flags, int (*cmpfunc)()); void libtar_list_free(libtar_list_t *l, void (*freefunc)()); int libtar_list_add_str(libtar_list_t *l, char *str, char *delim); int libtar_list_add(libtar_list_t *l, void *data); void libtar_list_del(libtar_list_t *l, libtar_node_t **n); int libtar_list_search(libtar_list_t *l, libtar_node_t **n, void *data, int (*matchfunc)()); int libtar_list_next(libtar_list_t *l, libtar_node_t **n); int libtar_list_prev(libtar_list_t *l, libtar_node_t **n); libtar_list_t *libtar_list_dup(libtar_list_t *l); libtar_list_t *libtar_list_merge(int (*cmpfunc)(), int flags, libtar_list_t *list1, libtar_list_t *list2); DESCRIPTION
The libtar_list_new() function creates a new list. The flags argument must be one of the following values: LIST_USERFUNC The cmpfunc argument points to a user-supplied function which determines the ordering of the list. LIST_STACK Use the list as a stack. New elements are added to the front of the list. LIST_QUEUE Use the list as a queue. New elements are added to the end of the list. The libtar_list_free() function deallocates all memory associated with the list l. If freefunc is not NULL, it is called to free memory associated with each node in the list. The libtar_list_add() function adds the element pointed to by data to the list l. The position of the new element will be determined by the flags passed to libtar_list_new() when the list was created. The libtar_list_add_str() function tokenizes the string str using the delimiter characters in the string delim. The resulting tokens are added to list l using libtar_list_add(). The libtar_list_search() function searches for an element which matches data using the matching function matchfunc. If matchfunc is NULL, a default matching function designed for ASCII strings is used. Searching begins from the node pointed to by n. The libtar_list_del() function removes the entry pointed to by n from the list pointed to by l. The libtar_list_dup() function creates a copy of the list l using dynamically allocated memory. The libtar_list_merge() function creates a new list with flags and cmpfunc, in the same way as libtar_list_new(). It then adds all ele- ments from list1 and list2 using libtar_list_add(). RETURN VALUE
The libtar_list_new(), libtar_list_dup(), and libtar_list_merge() functions return a pointer to the new list structure, or NULL on error. The libtar_list_next(), libtar_list_prev(), and libtar_list_search() functions return 1 when valid data is returned, or 0 otherwise. The libtar_list_add() and libtar_list_add_str() functions return 0 on success, or -1 on error. SEE ALSO
libtar_hash_new(3) University of Illinois Jan 2000 libtar_list_new(3)
All times are GMT -4. The time now is 10:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy