Sponsored Content
Top Forums Shell Programming and Scripting Match list of strings in File A and compare with File B, C and write to a output file in CSV format Post 302714013 by asnandhakumar on Thursday 11th of October 2012 02:52:14 PM
Old 10-11-2012
Hi Corona,

Expected output would be the list of lines that match with the job_ids that are present in the joblist.txt file.

Bascially, compare the list of job_ids present in the joblist.txt, with the job.log file and write only the lines that are matching with the job_ids >>to the output file

Thanks,
NK
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to compare two csv files values and write into another csv file

Hi all, Am new to scripting. So i just need your ideas to help me out. Here goes my requirement. I have two csv files 1.csv 2.csv abc,1.24 abc,1 def,2.13 def,1 I need to compare the first column of 1.csv with 2.csv and if matches then need to compare... (2 Replies)
Discussion started by: chinnahyd
2 Replies

2. Shell Programming and Scripting

format output in csv file

I am sending the output of a file to .csv file. The output should look like this: Total Customers Processed:,8 Total Customers Skipped:,0 Total Customers Added:,8 Total Customers Changed:,0 Total Policies Deleted:,0 Total Policies Failed:,0 total:,8 Now i want this output in... (1 Reply)
Discussion started by: Prashant Jain
1 Replies

3. Shell Programming and Scripting

extract strings from file and display in csv format

Hello All, I have a file whose data looks something like this I want to extract just the id, name and city fields in a csv format and sort them by id. Output should look like this. 1,psi,zzz 2,beta,pqr 3,theta,xyz 4,alpha,abc 5,gamma,jkl (12 Replies)
Discussion started by: grajp002
12 Replies

4. Shell Programming and Scripting

Csv format output file using scirpt

Hi All, I get the test result file daily after running the main test script. from the resultfile, need to fetch only server info and status and put them in tabular format in a file and as well in CSV format output file. I tried using awk command but am not able to put them in tabluar... (6 Replies)
Discussion started by: Optimus81
6 Replies

5. Shell Programming and Scripting

Compare 2 text file with 1 column in each file and write mismatch data to 3rd file

Hi, I need to compare 2 text files with around 60000 rows and 1 column. I need to compare these and write the mismatch data to 3rd file. File1 - file2 = file3 wc -l file1.txt 58112 wc -l file2.txt 55260 head -5 file1.txt 101214200123 101214700300 101250030067 101214100500... (10 Replies)
Discussion started by: Divya Nochiyil
10 Replies

6. Shell Programming and Scripting

Compare 2 files of csv file and match column data and create a new csv file of them

Hi, I am newbie in shell script. I need your help to solve my problem. Firstly, I have 2 files of csv and i want to compare of the contents then the output will be written in a new csv file. File1: SourceFile,DateTimeOriginal /home/intannf/foto/IMG_0713.JPG,2015:02:17 11:14:07... (8 Replies)
Discussion started by: refrain
8 Replies

7. Shell Programming and Scripting

Compare two and write updated output in third file

Hi Linux Experts. I have a requirement where i need to update the thousands of table definitions to extend the column length and character set therefore i am looking for some sort of linux script which i can use to update the length and chacterset. I have two files In first file i have 7... (1 Reply)
Discussion started by: Black-Linux
1 Replies

8. Shell Programming and Scripting

How to parse this file using awk and output in CSV format?

My source file looks like this: Cust-Number = "101" Cust-Name="Joe" Cust-Town="London" Cust-hobby="tennis" Cust-purchase="200" Cust-Number = "102" Cust-Name="Mary" Cust-Town="Newyork" Cust-hobby="reading" Cust-purchase="125" Now I want to parse this file (leaving out hobby) and... (10 Replies)
Discussion started by: Balav
10 Replies

9. UNIX for Beginners Questions & Answers

Use strings from nth field from one file to match strings in entire line in another file, awk

I cannot seem to get what should be a simple awk one-liner to work correctly and cannot figure out why. I would like to use patterns from a specific field in one file as regex to search for matching strings in the entire line ($0) of another file. I would like to output the lines of File2 which... (1 Reply)
Discussion started by: jvoot
1 Replies

10. Programming

Python or Shell script to Grep strings from input file and output in csv format

Hi Experts, I am writing a python script to grep string from file and display output in csv file as in attached screenshot https://drive.google.com/file/d/1gfUUdfmQma33tz65NskThYDhkZUGQO0H/view Input file(result_EPFT_config_device) Below is the python script i have prepared as of... (1 Reply)
Discussion started by: as7951
1 Replies
drmaa_wait(3)						       Sun Grid Engine DRMAA						     drmaa_wait(3)

NAME
drmaa_synchronize, drmaa_wait, drmaa_wifexited, drmaa_wexitstatus, drmaa_wifsignaled, drmaa_wtermsig, drmaa_wcoredump, drmaa_wifaborted - Waiting for jobs to finish SYNOPSIS
#include "drmaa.h" int drmaa_synchronize( const char *job_ids[], signed long timeout, int dispose, char *error_diagnosis, size_t error_diag_len ); int drmaa_wait( const char *job_id, char *job_id_out, size_t job_id_out_len, int *stat, signed long timeout, drmaa_attr_values_t **rusage, char *error_diagnosis, size_t error_diagnois_len ); int drmaa_wifaborted( int *aborted, int stat, char *error_diagnosis, size_t error_diag_len ); int drmaa_wifexited( int *exited, int stat, char *error_diagnosis, size_t error_diag_len ); int drmaa_wifsignaled( int *signaled, int stat, char *error_diagnosis, size_t error_diag_len ); int drmaa_wcoredump( int *core_dumped, int stat, char *error_diagnosis, size_t error_diag_len ); int drmaa_wexitstatus( int *exit_status, int stat, char *error_diagnosis, size_t error_diag_len ); int drmaa_wtermsig( char *signal, size_t signal_len, int stat, char *error_diagnosis, size_t error_diag_len ); DESCRIPTION
The drmaa_synchronize() function blocks the calling thread until all jobs specified in job_ids have failed or finished execution. If job_ids contains 'DRMAA_JOB_IDS_SESSION_ALL', then this function waits for all jobs submitted during this DRMAA session. The job_ids pointer array must be NULL terminated. To prevent blocking indefinitely in this call, the caller may use the timeout, specifying how many seconds to wait for this call to com- plete before timing out. The special value DRMAA_TIMEOUT_WAIT_FOREVER can be used to wait indefinitely for a result. The special value DRMAA_TIMEOUT_NO_WAIT can be used to return immediately. If the call exits before timeout seconds, all the specified jobs have completed or the calling thread received an interrupt. In both cases, the return code is DRMAA_ERRNO_EXIT_TIMEOUT. The dispose parameter specifies how to treat reaping information. If '0' is passed to this parameter, job finish information will still be available when drmaa_wait(3) is used. If '1' is passed, drmaa_wait(3) will be unable to access this job's finish information. drmaa_wait() The drmaa_wait() function blocks the calling thread until a job fails or finishes execution. This routine is modeled on the wait4(3) rou- tine. If the special string 'DRMAA_JOB_IDS_SESSION_ANY' is passed as job_id, this routine will wait for any job from the session. Other- wise the job_id must be the job identifier of a job or array job task that was submitted during the session. To prevent blocking indefinitely in this call, the caller may use timeout, specifying how many seconds to wait for this call to complete before timing out. The special value DRMAA_TIMEOUT_WAIT_FOREVER can be to wait indefinitely for a result. The special value DRMAA_TIME- OUT_NO_WAIT can be used to return immediately. If the call exits before timeout seconds have passed, all the specified jobs have completed or the calling thread received an interrupt. In both cases, the return code is DRMAA_ERRNO_EXIT_TIMEOUT. The routine reaps jobs on a successful call, so any subsequent calls to drmaa_wait(3) will fail returning a DRMAA_ERRNO_INVALID_JOB error, meaning that the job has already been reaped. This error is the same as if the job were unknown. Returning due to an elapsed timeout or an interrupt does not cause the job information to be reaped. This means that, in this case, it is possible to issue drmaa_wait(3) multiple times for the same job_id. If job_id_out is not a null pointer, then on return from a successful drmaa_wait(3) call, up to job_id_out_len characters from the job id of the failed or finished job are returned. If stat is not a null pointer, then on return from a successful drmaa_wait(3) call, the status of the job is stored in the integer pointed to by stat. stat indicates whether job failed or finished and other information. The information encoded in the integer value can be accessed via drmaa_wifaborted(3) drmaa_wifexited(3) drmaa_wifsignaled(3) drmaa_wcoredump(3) drmaa_wexitstatus(3) drmaa_wtermsig(3). If rusage is not a null pointer, then on return from a successful drmaa_wait(3) call, a summary of the resources used by the terminated job is returned in form of a DRMAA values string vector. The entries in the DRMAA values string vector can be extracted using drmaa_get_next_attr_value(3). Each string returned by drmaa_get_next_attr_value(3) will be of the format <name>=<value>, where <name> and <value> specify name and amount of resources consumed by the job, respectively. See accounting(5) for an explanation of the resource information. drmaa_wifaborted() The drmaa_wifaborted() function evaluates into the integer pointed to by aborted a non-zero value if stat was returned from a job that ended before entering the running state. drmaa_wifexited() The drmaa_wifexited() function evaluates into the integer pointed to by exited a non-zero value if stat was returned from a job that termi- nated normally. A zero value can also indicate that although the job has terminated normally, an exit status is not available, or that it is not known whether the job terminated normally. In both cases drmaa_wexitstatus(3) will not provide exit status information. A non-zero value returned in exited indicates more detailed diagnosis can be provided by means of drmaa_wifsignaled(3), drmaa_wtermsig(3) and drmaa_wcoredump(3). drmaa_wifsignaled() The drmaa_wifsignaled() function evaluates into the integer pointed to by signaled a non-zero value if stat was returned for a job that terminated due to the receipt of a signal. A zero value can also indicate that although the job has terminated due to the receipt of a sig- nal, the signal is not available, or it is not known whether the job terminated due to the receipt of a signal. In both cases drmaa_wterm- sig(3) will not provide signal information. A non-zero value returned in signaled indicates signal information can be retrieved by means of drmaa_wtermsig(3). drmaa_wcoredump() If drmaa_wifsignaled(3) returned a non-zero value in the signaled parameter, the drmaa_wcoredump() function evaluates into the integer pointed to by core_dumped a non-zero value if a core image of the terminated job was created. drmaa_wexitstatus() If drmaa_wifexited(3) returned a non-zero value in the exited parameter, the drmaa_wexitstatus() function evaluates into the integer pointed to by exit_code the exit code that the job passed to exit(2) or the value that the child process returned from main. drmaa_wtermsig() If drmaa_wifsignaled(3) returned a non-zero value in the signaled parameter, the drmaa_wtermsig() function evaluates into signal up to sig- nal_len characters of a string representation of the signal that caused the termination of the job. For signals declared by POSIX.1, the symbolic names are returned (e.g., SIGABRT, SIGALRM). For signals not declared by POSIX, any other string may be returned. ENVIRONMENTAL VARIABLES
SGE_ROOT Specifies the location of the Sun Grid Engine standard configuration files. SGE_CELL If set, specifies the default Sun Grid Engine cell to be used. To address a Sun Grid Engine cell Sun Grid Engine uses (in the order of precedence): The name of the cell specified in the environment variable SGE_CELL, if it is set. The name of the default cell, i.e. default. SGE_DEBUG_LEVEL If set, specifies that debug information should be written to stderr. In addition the level of detail in which debug infor- mation is generated is defined. SGE_QMASTER_PORT If set, specifies the tcp port on which sge_qmaster(8) is expected to listen for communication requests. Most installations will use a services map entry instead to define that port. RETURN VALUES
Upon successful completion, drmaa_run_job(), drmaa_run_bulk_jobs(), and drmaa_get_next_job_id() return DRMAA_ERRNO_SUCCESS. Other values indicate an error. Up to error_diag_len characters of error related diagnosis information is then provided in the buffer error_diagnosis. ERRORS
The drmaa_synchronize(), drmaa_wait(), drmaa_wifexited(), drmaa_wexitstatus(), drmaa_wifsignaled(), drmaa_wtermsig(), drmaa_wcoredump(), and drmaa_wifaborted() will fail if: DRMAA_ERRNO_INTERNAL_ERROR Unexpected or internal DRMAA error, like system call failure, etc. DRMAA_ERRNO_DRM_COMMUNICATION_FAILURE Could not contact DRM system for this request. DRMAA_ERRNO_AUTH_FAILURE The specified request is not processed successfully due to authorization failure. DRMAA_ERRNO_INVALID_ARGUMENT The input value for an argument is invalid. DRMAA_ERRNO_NO_ACTIVE_SESSION Failed because there is no active session. DRMAA_ERRNO_NO_MEMORY Failed allocating memory. The drmaa_synchronize() and drmaa_wait() functions will fail if: DRMAA_ERRNO_EXIT_TIMEOUT Time-out condition. DRMAA_ERRNO_INVALID_JOB The job specified by the does not exist. The drmaa_wait() will fail if: DRMAA_ERRNO_NO_RUSAGE This error code is returned by drmaa_wait() when a job has finished but no rusage and stat data could be provided. SEE ALSO
drmaa_submit(3). SGE 6.2u5 $Date$ drmaa_wait(3)
All times are GMT -4. The time now is 05:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy