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
NWPJMV(1)							      nwpjmv								 NWPJMV(1)

NAME
nwpjvm - Move print job to Unix queue SYNOPSIS
nwpjmv [ -S server ] [ -h ] [ -U user name ] [ -P password | -n ] [ -C ] [ -q queue name ] [ -c command ] [ -j job number ] [ -d ] DESCRIPTION
nwpjmv is a program that connects to print queues on NetWare servers and moves a designated print job to a Unix queue. OPTIONS
-h -h is used to print out a short help text. -S server server is the name of the server you want to use. -U user user is the print server name at the server. -P password password is the password to use for the print server at the server. If neither -n nor -P are given, and the user has no open connection to the server, pserver prompts for a password. -n -n should be given if the print server does not require a password. -C By default, passwords are converted to uppercase before they are sent to the server, because most servers require this. You can turn off this conversion by -C. -q queue name queue name is the name of the print queue you want to service. -c command nwpjmv removes the designated job from the Novell queue and feeds the job file to stdin. command is the printing command that is exe- cuted for each job. The default command is 'lpr'. You can insert several flags into the command, preceded by %. These are replaced with values retrieved from the queue structure for the print job. %u: This field will be replaced by the name of the user who posted this print job. %d: This field will be replaced by the job description field of this print job. -j job number This designates the ID number of the print job to be moved. -d causes extra error messages to be logged. SEE ALSO
nwclient(5), slist(1), pqlist(1), ncpmount(8), ncpumount(8), pserver(1) CREDITS
nwpjmv was written by Bruno Browning (bruno@lss.wisc.edu) based on pserver by Volker Lendecke (lendecke@math.uni-goettingen.de) nwpjmv 03/15/2003 NWPJMV(1)
All times are GMT -4. The time now is 01:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy