Splitting XML file on basis of line number into multiple file
Hi All,
I have more than half million lines of XML file , wanted to split in four files in a such a way that top 7 lines should be present in each file on top and bottom line of should be present in each file at bottom.
from the 8th line actual record starts and each record contains 15 lines means from 8th to 22nd line is the first record of the file.
so the total number of actual records are varying each time.
wanted to divide this actual record in four chunks and each chunks should move to new four files respectively below to the top 7 and above the bottom line.
say...
Code:
cat ABCD.xml |wc -l
690728
Actual Record lines = 690728 -[top 7] -[bottom1]= 690720
690720/15 = Actual Record = 46048
then
46048/4 = 11512 or [if it is not exactly divisible then the remainder record should move to the last ]
so first 11512 record move to ABCD_part1.xml
second 11512 will move to ABCD_part2.xml
third 11512 will move move to ABCD_part3.xml
Fourth/remaining records 11512 will move to to ABCD_part4.xml
Please help on this .
Last edited by Don Cragun; 05-17-2014 at 05:08 PM..
Reason: Add CODE tags again.
To split the files
Hi,
I'm having a xml file with multiple xml header. so i want to split the file into multiple files.
Test.xml
---------
<?xml version="UTF_8">
<emp: ....>
<name>a</name>
<age>10</age>
</emp>
<?xml version="UTF_8">
<emp: ....>
<name>b</name>
<age>10</age>... (11 Replies)
Hi, Please help on this. i want split the below file(11020111.CLT) to more files with some condition. :b:
1) %s stating of the report
2) %e ending of the report
example starting of the report:
%sAEGONCA| |MUMBAI | :EXPC|N|D
ending of the report
%eAEGONCA| |MUMBAI | :EXPC
3)so the... (10 Replies)
Hi,
I have a huge file with a single line.
But I want to break that line into lines of with each line having five columns.
My file is like this:
code:
"hi","there","how","are","you?","It","was","great","working","with","you.","hope","to","work","you."
I want it like this:
code:... (1 Reply)
HI All,
I have to split a xml file into multiple xml files and append it in another .xml file. for example below is a sample xml and using shell script i have to split it into three xml files and append all the three xmls in a .xml file. Can some one help plz.
eg:
<?xml version="1.0"?>... (4 Replies)
Hi I have a file with over a million lines (rows) and I want to split everything from 500,000 to a million into another file (to make the file smaller). Is there a simple command for this?
Thank you
Phil (4 Replies)
Can u pls advise the unix command as I have a file which contain the records in the below format
333434
435435
435443
434543
343536
Now the total line count is 89380 , now i want to create a separate
I am trying to split my large big file into small bits using the line... (2 Replies)
Hi Everyone,
I'm new here and I was checking this old post:
/shell-programming-and-scripting/180669-splitting-file-into-several-smaller-files-using-perl.html
(cannot paste link because of lack of points)
I need to do something like this but understand very little of perl.
I also check... (4 Replies)
Hi,
I'm having a xml file with multiple xml header. so i want to split the file into multiple files.
Sample.xml consists multiple headers so how can we split these multiple headers into multiple files in unix.
eg :
<?xml version="1.0" encoding="UTF-8"?>
<ml:individual... (3 Replies)
I have to split a file containing 100 lines to 5 files say from lines ,1-20 ,21-30 ,31-40 ,51-60 ,61-100
Here is i can do it for 2 file but how to handle it for more than 2 files
awk 'NR < 21{ print >> "a"; next } {print >> "b" }' $input_file
Please advidse.
Thanks (4 Replies)
Discussion started by: abhaydas
4 Replies
LEARN ABOUT NETBSD
gelf_update_move
GELF_GETMOVE(3) BSD Library Functions Manual GELF_GETMOVE(3)NAME
gelf_getmove, gelf_update_move -- read and update Elf Move information
LIBRARY
ELF Access Library (libelf, -lelf)
SYNOPSIS
#include <gelf.h>
GElf_Move *
gelf_getmove(Elf_Data *data, int ndx, GElf_Move *move);
int
gelf_update_move(Elf_Data *data, int ndx, GElf_Move *move);
DESCRIPTION
These convenience functions are used to retrieve and update class-dependent Elf32_Move and Elf64_Move structures in an ELF object.
Argument data is an Elf_Data descriptor associated with a section of type SHT_SUNW_move. Argument ndx is the index of the move record being
retrieved or updated. The class-independent GElf_Move structure is described in gelf(3).
Function gelf_getmove() retrieves class-dependent move record at index ndx in data buffer data and copies it to the destination pointed to by
argument move after translation to class-independent form.
Function gelf_update_move() converts the class-independent move information pointed to by argument move to class-dependent form, and writes
it to the move record at index ndx in the data buffer described by argument data. Function gelf_update_move() signals an error if any of the
values in the class-independent representation exceeds the representable limits of the target type.
RETURN VALUES
Function gelf_getmove() returns the value of argument move if successful, or NULL in case of an error. Function gelf_update_move() returns a
non-zero value if successful, or zero in case of an error.
ERRORS
These functions may fail with the following errors:
[ELF_E_ARGUMENT] Arguments data or move were NULL.
[ELF_E_ARGUMENT] Argument ndx was less than zero or larger than the number of records in the data descriptor.
[ELF_E_ARGUMENT] Data descriptor data was not associated with a section containing move information.
[ELF_E_RANGE] A value was not representable in the target type.
SEE ALSO elf(3), elf_getdata(3), elf_getscn(3), gelf(3)BSD August 29, 2006 BSD