Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Updating a field in a File without creating temp file's Post 302320623 by prabhutkl on Thursday 28th of May 2009 12:27:18 PM
Old 05-28-2009
Updating a field in a File without creating temp file's

Hi Experts,

I have a requirement where i need to update the below items in file,

1. END TIME
2. PREV_STATUS

For the first time the PREV_status and end time of all job the job will be sysdate & NULL reply as below,

Session_name,Load Type,Frequency,Seesion End time,Prev_Status
s_d_m_crm_srr_team_sales,Full,Daily,28-MAY-2009 19:30:00,
s_d_m_crm_srr_team_mbrs_sales,Full,Daily,28-MAY-2009 18:30:00,
s_d_m_crm_srr_team_history_sales,Full,Daily,28-MAY-2009 17:30:00,
s_d_m_crm_srr_employees_sales,Full,Daily,28-MAY-2009 19:50:00,
s_d_m_crm_srr_jobs_sales,Full,Daily,28-MAY-2009 11:30:00,
s_d_m_crm_srr_employee_job_hist_sales,Full,Daily,28-MAY-2009 12:30:00,
s_d_m_crm_srr_x_tmbr_cust_sales,Full,Daily,28-MAY-2009 10:30:00,
s_d_m_crm_srr_x_team_tmbr_sales,Full,Daily,28-MAY-2009 11:30:00,
s_d_m_crm_srr_employees_specifics,Full,Daily,28-MAY-2009 09:30:00,
s_d_m_crm_srr_team_hierarchy_sales,Full,Daily,28-MAY-2009 01:30:00,

On successful completion of each job has to update the record's as below reply,

Session_name,Load Type,Frequency,Seesion End time,Prev_Status
s_d_m_crm_srr_team_sales,Full,Daily,29-MAY-2009 19:30:00,SUCCEEDED
s_d_m_crm_srr_team_mbrs_sales,Full,Daily,29-MAY-2009 18:30:00,FAILED
s_d_m_crm_srr_team_history_sales,Full,Daily,28-MAY-2009 17:30:00,
s_d_m_crm_srr_employees_sales,Full,Daily,29-MAY-2009 19:50:00,SUCCEEDED
s_d_m_crm_srr_jobs_sales,Full,Daily,29-MAY-2009 11:30:00,SUCCEEDED
s_d_m_crm_srr_employee_job_hist_sales,Full,Daily,29-MAY-2009 12:30:00,SUCCEEDED
s_d_m_crm_srr_x_tmbr_cust_sales,Full,Daily,29-MAY-2009 10:30:00,SUCCEEDED
s_d_m_crm_srr_x_team_tmbr_sales,Full,Daily,29-MAY-2009 11:30:00,SUCCEEDED
s_d_m_crm_srr_employees_specifics,Full,Daily,29-MAY-2009 09:30:00,SUCCEEDED
s_d_m_crm_srr_team_hierarchy_sales,Full,Daily,29-MAY-2009 01:30:00,SUCCEEDED

Since I am going to run the all the jobs parallely and there is high possiblity of updating the status and END TIME parallely in a file.

It has to update only one record in file without any temporary file to miss the latest updation.

It will be grateful if you could help me out to get sort out my requirement?

Thanks,
Prabhu
 

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Append to end of each line of file without a temp file.

Hello I am trying to append an incrimenting number to the end of each line I have it working with a temp file. But I want to do this without a temp file. a=1 cat "file" | while read LINE do echo "$LINE, $a" >> filewithnumbers a=`expr $a + 1` ... (4 Replies)
Discussion started by: rorey_breaker
4 Replies

2. Shell Programming and Scripting

awk updating one file with another, comparing, updating

Hello, I read and search through this wonderful forum and tried different approaches but it seems I lack some knowledge and neurones ^^ Here is what I'm trying to achieve : file1: test filea 3495; test fileb 4578; test filec 7689; test filey 9978; test filez 12300; file2: test filea... (11 Replies)
Discussion started by: mecano
11 Replies

3. Shell Programming and Scripting

find and replace a string in a file without the use of temp file

Hi - I am looking for a replacing a string in a in multiple *.sql files in directory with a new string without using a temporary file Normally I can use sed command as below for W in ls `FILE*.sql` do sed 's/OLD/NEW/g' $W > TEMPFILE.dat mv TEMPFILE.dat $W done But Here in my... (9 Replies)
Discussion started by: raghutapal
9 Replies

4. Shell Programming and Scripting

Lookup on large file based on a temp file

hello guys Please help me with the below issue I have two files one base file another lookupfile base file abc-001 bcd-001 cde-001 Lookupfile abc-001|11|12 abc-001|11|12 abc-001|11|12 (6 Replies)
Discussion started by: Pratik4891
6 Replies

5. Shell Programming and Scripting

Store the name of an extracted file to a temp file

What would be the best way to store the name of an extracted file from a tar to a text file? I want to extract one file from a tar and store the name of the extracted file to a temp file. tar -xvf tar_file.tar file_to_be_extracted (1 Reply)
Discussion started by: erin00
1 Replies

6. UNIX for Advanced & Expert Users

Creating the script for updating or replacing the existing http.conf file

Hi I need some help with a task, i am an absolute newbie to any form of shell scripting and request guidance. I have been building a proxy server using the apache mod proxy currently my solution is working , but i need to automate the process , suppose if any changes need to be made on... (0 Replies)
Discussion started by: satej
0 Replies
QSTAT(1)						User Contributed Perl Documentation						  QSTAT(1)

NAME
qstat - display job/partition information in a familiar pbs format SYNOPSIS
qstat [-f] [-a|-i|-r] [-n [-1]] [-G|-M] [-u user_list] [-? | --help] [--man] [job_id...] qstat -Q [-f] qstat -q DESCRIPTION
The qstat command displays information about jobs. OPTIONS
-a Displays all jobs in a single-line format. See the STANDARD OUTPUT section for format details. -i Displays information about idle jobs. This includes jobs which are queued or held. -f Displays the full information for each selected job in a multi-line format. See the STANDARD OUTPUT section for format details. -G Display size information in gigabytes. -M Show size information, disk or memory in mega-words. A word is considered to be 8 bytes. -n Displays nodes allocated to a job in addition to the basic information. -1 In combination with -n, the -1 option puts all of the nodes on the same line as the job id. -r Displays information about running jobs. This includes jobs which are running or suspended. -u user_list Display job information for all jobs owned by the specified user(s). The format of user_list is: user_name[,user_name...]. -? | --help brief help message --man full documentation STANDARD OUTPUT
Displaying Job Status If the -a, -i, -f, -r, -u, -n, -G, and -M options are not specified, the brief single-line display format is used. The following items are displayed on a single line, in the specified order, separated by white space: the job id the job name the job owner the cpu time used the job state C - Job is completed after having run E - Job is exiting after having run. H - Job is held. Q - job is queued, eligible to run or routed. R - job is running. T - job is being moved to new location. W - job is waiting for its execution time (-a option) to be reached. S - job is suspended. the queue that the job is in If the -f option is specified, the multi-line display format is used. The output for each job consists of the header line: Job Id: job identifier followed by one line per job attribute of the form: attribute_name = value If any of the options -a, -i, -r, -u, -n, -G or -M are specified, the normal single-line display format is used. The following items are displayed on a single line, in the specified order, separated by white space: the job id the job owner the queue the job is in the job name the session id (if the job is running) the number of nodes requested by the job the number of cpus or tasks requested by the job the amount of memory requested by the job either the cpu time, if specified, or wall time requested by the job, (in hh:mm) the job state The amount of cpu time or wall time used by the job (in hh:mm) EXIT STATUS
On success, qstat will exit with a value of zero. On failure, qstat will exit with a value greater than zero. perl v5.14.2 2012-04-10 QSTAT(1)
All times are GMT -4. The time now is 04:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy