Sponsored Content
Top Forums Shell Programming and Scripting Split large xml into mutiple files and with header and footer in file Post 303030293 by karthik on Thursday 7th of February 2019 06:08:11 PM
Old 02-07-2019
Thanks Rudic it worked.

--- Post updated at 11:06 PM ---

Hi Rudic,

Need one more help I have a xml file with the below job_id repetition, for every response i get from service it will generate one job_id i will store that in a response.xml file
my requirement is to pick the job_id's and store it in a variable with comma seperator as the below format and pass that variable value to DB as input


Required output:
Code:
30537,30538,30539

XML :
Code:
JobUnique_Id><ns11:Job_Id>30537</ns11:Job_Id></ns6:JobResponse>
             <ns11:Job_Id>30538</ns11:Job_Id
             <ns11:Job_Id>30539</ns11:Job_Id

--- Post updated at 11:08 PM ---

Rudic reply helped me sorry for not briefing you the problem in detail.

Last edited by karthik; 02-07-2019 at 09:04 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to Chop Header and Footer record from input file

Hi, I need to chope the header and footer record from an input file and make a new output file, please let me know how i can do it in unix.thanks. (4 Replies)
Discussion started by: coolbudy
4 Replies

2. Shell Programming and Scripting

Total of lines w/out header and footer incude for a file

I am trying to get a total number of tapes w/out headers or footers in a ERV file and append it to the file. For some reason I cannot get it to work. Any ideas? #!/bin/sh dat=`date +"%b%d_%Y"` + date +%b%d_%Y dat=Nov16_2006 tapemgr="/export/home/legato/tapemgr/rpts"... (1 Reply)
Discussion started by: gzs553
1 Replies

3. Shell Programming and Scripting

Split large file and add header and footer to each file

I have one large file, after every 200 line i have to split the file and the add header and footer to each small file? It is possible to add different header and footer to each file? (1 Reply)
Discussion started by: ashish4422
1 Replies

4. Shell Programming and Scripting

Split large file and add header and footer to each small files

I have one large file, after every 200 line i have to split the file and the add header and footer to each small file? It is possible to add different header and footer to each file? (7 Replies)
Discussion started by: ashish4422
7 Replies

5. Shell Programming and Scripting

sort a report file having header and footer

I am having report file with header and footer . The details in between header and footer are separated by a pipe charater. I want to sort the file by considering multiple columns in between header and footer. pls help (4 Replies)
Discussion started by: suryanarayana
4 Replies

6. Shell Programming and Scripting

Add header and footer with record count in footer

This is my file(Target.txt) name|age|locaction abc|23|del xyz|24|mum jkl|25|kol The file should be like this 1|03252012 1|name|age|location 2|abc|23|del 2|xyz|24|mum 2|jkl|25|kol 2|kkk|26|hyd 3|4 Column 1 is row indicator for row 1 and 2, column indicator is 1,for data rows... (1 Reply)
Discussion started by: itsranjan
1 Replies

7. Shell Programming and Scripting

Removing header or footer from file

Hi Every one, what is the coomand to remove header or footer from a file. Please help me by providing command/syntax to remove header/footer from unix. Thanks in advance for all your support. (5 Replies)
Discussion started by: sridhardwh
5 Replies

8. Shell Programming and Scripting

Is there a way to append both at header and footer of a file

currently I've a file Insert into CD_CARD_TYPE (CODE, DESCRIPTION, LAST_UPDATE_BY, LAST_UPDATE_DATE) Values ('024', '024', 2, sysdate); Insert into CD_CARD_TYPE (CODE, DESCRIPTION, LAST_UPDATE_BY, LAST_UPDATE_DATE) Values ('032', '032', 2, sysdate); ........ is it... (3 Replies)
Discussion started by: jediwannabe
3 Replies

9. UNIX for Dummies Questions & Answers

File Row Line Count without Header Footer

Hi There! I am saving the file count of all files in a directory to an output file using: wc -l * > FileCount.txt I get: 114 G4SXORD 3 G4SXORH 0 G4SXORP 117 total But this count includes header and footer. I want to subtract 2 from the count and get ... (7 Replies)
Discussion started by: gagan8877
7 Replies

10. UNIX for Dummies Questions & Answers

Eliminate Header and footer from EBCDIC file

Is there any command to eliminate Header and footer from EBCDIC file (4 Replies)
Discussion started by: abhilashnair
4 Replies
Slurm API(3)						    Slurm checkpoint functions						      Slurm API(3)

NAME
slurm_checkpoint_able, slurm_checkpoint_complete, slurm_checkpoint_create, slurm_checkpoint_disable, slurm_checkpoint_enable, slurm_check- point_error, slurm_checkpoint_restart, slurm_checkpoint_vacate - Slurm checkpoint functions SYNTAX
#include <slurm/slurm.h> int slurm_checkpoint_able ( uint32_t job_id, uint32_t step_id, time_t *start_time, ); int slurm_checkpoint_complete ( uint32_t job_id, uint32_t step_id, time_t start_time, uint32_t error_code, char *error_msg ); int slurm_checkpoint_create ( uint32_t job_id, uint32_t step_id, uint16_t max_wait, char *image_dir ); int slurm_checkpoint_disable ( uint32_t job_id, uint32_t step_id ); int slurm_checkpoint_enable ( uint32_t job_id, uint32_t step_id ); int slurm_checkpoint_error ( uint32_t job_id, uint32_t step_id, uint32_t *error_code, char ** error_msg ); int slurm_checkpoint_restart ( uint32_t job_id, uint32_t step_id, uint16_t stick, char *image_dir ); int slurm_checkpoint_tasks ( uint32_t job_id, uint32_t step_id, time_t begin_time, char *image_dir, uint16_t max_wait, char *nodelist ); int slurm_checkpoint_vacate ( uint32_t job_id, uint32_t step_id, uint16_t max_wait, char *image_dir ); ARGUMENTS
begin_time When to begin the operation. error_code Error code for checkpoint operation. Only the highest value is preserved. error_msg Error message for checkpoint operation. Only the error_msg value for the highest error_code is preserved. image_dir Directory specification for where the checkpoint file should be read from or written to. The default value is specified by the JobCheckpointDir SLURM configuration parameter. job_id SLURM job ID to perform the operation upon. max_wait Maximum time to allow for the operation to complete in seconds. nodelist Nodes to send the request. start_time Time at which last checkpoint operation began (if one is in progress), otherwise zero. step_id SLURM job step ID to perform the operation upon. May be NO_VAL if the operation is to be performed on all steps of the specified job. Specify SLURM_BATCH_SCRIPT to checkpoint a batch job. stick If non-zero then restart the job on the same nodes that it was checkpointed from. DESCRIPTION
slurm_checkpoint_able Report if checkpoint operations can presently be issued for the specified job step. If yes, returns SLURM_SUCCESS and sets start_time if checkpoint operation is presently active. Returns ESLURM_DISABLED if checkpoint operation is disabled. slurm_checkpoint_complete Note that a requested checkpoint has been completed. slurm_checkpoint_create Request a checkpoint for the identified job step. Continue its execution upon completion of the checkpoint. slurm_checkpoint_disable Make the identified job step non-checkpointable. This can be issued as needed to prevent checkpointing while a job step is in a critical section or for other reasons. slurm_checkpoint_enable Make the identified job step checkpointable. slurm_checkpoint_error Get error information about the last checkpoint operation for a given job step. slurm_checkpoint_restart Request that a previously checkpointed job resume execution. It may continue execution on different nodes than were originally used. Execution may be delayed if resources are not immediately available. slurm_checkpoint_vacate Request a checkpoint for the identified job step. Terminate its execution upon completion of the checkpoint. RETURN VALUE
Zero is returned upon success. On error, -1 is returned, and the Slurm error code is set appropriately. ERRORS
ESLURM_INVALID_JOB_ID the requested job or job step id does not exist. ESLURM_ACCESS_DENIED the requesting user lacks authorization for the requested action (e.g. trying to delete or modify another user's job). ESLURM_JOB_PENDING the requested job is still pending. ESLURM_ALREADY_DONE the requested job has already completed. ESLURM_DISABLED the requested operation has been disabled for this job step. This will occur when a request for checkpoint is issued when they have been disabled. ESLURM_NOT_SUPPORTED the requested operation is not supported on this system. EXAMPLE
#include <stdio.h> #include <stdlib.h> #include <slurm/slurm.h> #include <slurm/slurm_errno.h> int main (int argc, char *argv[]) { uint32_t job_id, step_id; if (argc < 3) { printf("Usage: %s job_id step_id ", argv[0]); exit(1); } job_id = atoi(argv[1]); step_id = atoi(argv[2]); if (slurm_checkpoint_disable(job_id, step_id)) { slurm_perror ("slurm_checkpoint_error:"); exit (1); } exit (0); } NOTE
These functions are included in the libslurm library, which must be linked to your process for use (e.g. "cc -lslurm myprog.c"). COPYING
Copyright (C) 2004-2007 The Regents of the University of California. Copyright (C) 2008-2009 Lawrence Livermore National Security. Pro- duced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). CODE-OCEC-09-009. All rights reserved. This file is part of SLURM, a resource management program. For details, see <http://www.schedmd.com/slurmdocs/>. SLURM is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. SLURM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. SEE ALSO
srun(1), squeue(1), free(3), slurm.conf(5) Morris Jette March 2009 Slurm API(3)
All times are GMT -4. The time now is 07:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy