Sponsored Content
Top Forums Shell Programming and Scripting Outputting from two input files. Post 302113665 by Liguidsoul on Sunday 8th of April 2007 10:45:44 PM
Old 04-08-2007
Outputting from two input files.

Ok, lets suppose I have two files like so:

file1

John 5441223
Sandy 113446
Jill 489799

file2

Sandy Tuesday
Jill Friday
John Monday

Is it possible to match records from these two files and output them into one output file? For example, lets suppose I want to output like this:

John Monday 5441223
Sandy Tuesday 113446
etc...

Preferably by looping if possible so I don't have sloppy code.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed not outputting last line of input file

I am using sed for a simple substitution (see command syntax below). Everything works fine except that the last line of the input file does not get written to the output file. Has anyone ever seen this and know of way to force the last line to be written? I don't know if it's playing a part in... (3 Replies)
Discussion started by: 2reperry
3 Replies

2. Shell Programming and Scripting

Help in outputting the result in log files

This is the file am having: "40","1G1AL55 ",30482,9000 "40","1G1ZT58 ",29098,10600 "40","1G1AL15 ",29222,9400 "46","1G6KD57 ",3083,28400 "46","1G6KD57 ",27909,25200 "49","1G1ZU57 ",16391,13900 "49","1G2ZG58 ",28856,12400 I want to display the output in three files... (23 Replies)
Discussion started by: dave_nithis
23 Replies

3. 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

4. Shell Programming and Scripting

Reading specific contents from 1 input files and appending it to another input file

Hi guys, I am new to AWK and unix scripting. Please see below my problem and let me know if anyone you can help. I have 2 input files (example given below) Input file 2 is a standard file (it will not change) and we have to get the name (second column after comma) from it and append it... (5 Replies)
Discussion started by: sksahu
5 Replies

5. Shell Programming and Scripting

write a perl script or kornshell reading a two files and outputting to comma format

Hello Can someone help me to write a perl script or kornshell reading a two files and outputting to comma format. Here is the two files listofdisks.txt id, diskname, diskgroup, diskisze(GB), FC 1, CN34, GRP1, 30, FC_CN34 2, CN67, GRP5, 19, 4, VD1, GRP4, 23, FC_VD1 6, CF_D1, ... (0 Replies)
Discussion started by: deiow
0 Replies

6. UNIX for Dummies Questions & Answers

rm command-outputting files as they are deleted?

Solaris 10/Korn Hi unix experts!, Is it possible to output the actual file names to a file as they are being deleted via the rm command? Context: Im executing the shell script at the command line and directing the output to an output file eg purgescript.ksh > output.lst within the... (3 Replies)
Discussion started by: satnamx
3 Replies

7. Shell Programming and Scripting

Script to delete files with an input for directories and an input for path/file

Hello, I'm trying to figure out how best to approach this script, and I have very little experience, so I could use all the help I can get. :wall: I regularly need to delete files from many directories. A file with the same name may exist any number of times in different subdirectories.... (3 Replies)
Discussion started by: *ShadowCat*
3 Replies

8. Shell Programming and Scripting

Read input files and merge them in given order and write them to input one param or one file

Dear Friends, I am looking for a shell script to merge input files into one file .. here is my idea: 1st paramter would be outfile file (all input files content) read all input files and merge them to input param 1 ex: if I pass 6 file names to the script then 1st file name as output file... (4 Replies)
Discussion started by: hyd1234
4 Replies

9. UNIX for Dummies Questions & Answers

Outputting 1 file per row if pattern exists between files

I have many files that can have various amounts of rows. I essentially want to output each row into a new file if a pattern is matched between two files. I have some code that does something similar but I want it to output every single input row from every file into a separate output file; that... (5 Replies)
Discussion started by: verse123
5 Replies

10. UNIX for Beginners Questions & Answers

Comparing fastq files and outputting common records

I have two files: File_1: @M04961:22:000000000-B5VGJ:1:1101:9280:7106 1:N:0:86 GGCATGAAAACATACAAACCGTCTTTCCAGAAATTGTTCCAAGTATCGGCAACAGCTTTATCAATACCATGAAAAATATCAACCACACCAGAAGCAGCAT + GGGGGGGGGGGGGGGGGCCGGGGGF,EDFFGEDFG,@DGGCGGEGGG7DCGGGF68CGFFFGGGG@CGDGFFDFEFEFF:30CGAFFDFEFF8CAF;;8F ... (3 Replies)
Discussion started by: Xterra
3 Replies
time_lock_es(3) 					     Library Functions Manual						   time_lock_es(3)

NAME
time_lock_es - Check time-of-day locking (Enhanced Security) LIBRARY
Security Library (libsecurity.so) SYNOPSIS
#include <sys/types.h> #include <sys/security.h> #include <prot.h> int time_lock_es ( struct es_passwd *prpwd ); PARAMETERS
Specifies a protected password entry structure. DESCRIPTION
The time_lock_es() function performs time-of-day lock checking for the current date and time against the time-of-day specification in the fd_tod string of the prpwd parameter. The function returns 1 if the time lock is on and 0 if there is no lock. The fd_tod specification is like that found in the UUCP Systems file. The specification is a comma-separated list of entries. If the cur- rent time matches an entry in the specification, the time lock is not on. The entries are scanned until a match is found. If no match can be found, the time lock is on. Each entry appears as follows: <day><start_time-end_time> The day is one of the following: Matches any day of the week. Matches Monday through Friday. Sunday Monday Tuesday Wednesday Thursday Friday Saturday The times are military time, for example, 9:15 am is 0915, 6:00 pm is 1800, and 12:42 am is 0042. When start_time is less than end_time, the range of times contains valid times in which to log in that day. When the times are equal or there is only one time (including no time at all), the entire day is valid. When start_time is later than end_time, times outside the range are valid. For instance, if start_time is 04:15 and end_time is 02:00, then any time that falls outside the range of 02:00 to 04:15 is a valid time. NOTES
Programs using this function must be compiled with -lsecurity. In order to quickstart a program, the program must be linked as follows: -lsecurity -ldb -laud -lm See the shared library discussion in the Programmer's Guide for more information about using the quickstarting feature. delim off time_lock_es(3)
All times are GMT -4. The time now is 04:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy