07-21-2004
Thanks zazzybob and Ygor for your help. But I see some problem with each of your scripts.
zazzybob's script - First of all I have a fixed length data file that I need to split. The script creates seperate files with the intended data but it ignores the spaces in the fields, means it concatenates the fields leaving out the spaces in them.
Ygor's script - Your script creates only one file named DOC with the data between the last DOC/END. But it puts the data like what it is in the input file, that is a good sign.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have gone through all the threads in the forum and tested out different things. I am trying to split a 3GB file into multiple files. Some files are even larger than this.
For example:
split -l 3000000 filename.txt
This is very slow and it splits the file with 3 million records in each... (10 Replies)
Discussion started by: madhunk
10 Replies
2. Shell Programming and Scripting
I did a lot of search on this forum on spiting file; found a lot, but my requirement is a bit different, please guide.
Master file:
x:start:5
line1:23
line2:12
2:90
x:end:5
x:start:2
45:56
22:90
x:end:2
x:start:3
line1:23
line2:12
x:end:3
x:start:2
line5:23 (1 Reply)
Discussion started by: uwork72
1 Replies
3. Shell Programming and Scripting
How can I split a text file (in awk) in n others with number of record given in input?
Thanks (6 Replies)
Discussion started by: pinguc
6 Replies
4. Shell Programming and Scripting
Hi ,
I just need to split a file and outputfiles are redirected to gzip file
need:
Input file - A.gz
content of A.gz is
100|sfdds|dffdds|200112|sdfdf
100|sfdds|dffdds|200112|sdfdf
100|sfdds|dffdds|200112|sdfdf
100|sfdds|dffdds|200212|sdfdf
100|sfdds|dffdds|200212|sdfdf... (3 Replies)
Discussion started by: mohan_xunil
3 Replies
5. Shell Programming and Scripting
Hello,
I have a file like the following:
david,a,b,c,20,r
thomas,a,b,c,30,r
willaiam,a,b,c,80,r
barbara,a,b,c,100,r
I would like to split the file into other files using a condition for the contents of column 5.
The condition should be a if the contents of column 5 is in a range... (4 Replies)
Discussion started by: keenboy100
4 Replies
6. Shell Programming and Scripting
Hi All,
Input.txt
XYZONEABC
CZXTWOJJJ
KKKSIXOOO
asdfhajlsdhfajs
asdfasfasdf
Output Files:
ONE.txt
XYZONEABC
TWO.txt
CZXTWOJJJ
SIX.txt
KKKSIXOOO
I had a script (2 Replies)
Discussion started by: kmsekhar
2 Replies
7. Shell Programming and Scripting
Hi!
I have a file like this:
a,b,c,12,d,e
a,b,c,13,d,e
a,b,c,14,d,e
a,b,c,15,d,e
a,b,c,16,d,e
a,b,c,17,d,e
I need to split that file in two:
If field 4 is equal or higher than 14 that row goes to one file and if it is equal or higher than 15 to another.
Can anyone point me in the... (2 Replies)
Discussion started by: Tr0cken
2 Replies
8. Shell Programming and Scripting
Hi all,
I'm pretty new to Shell scripting and I need some help to split a source text file into multiple files. The source has a row with pattern where the file needs to be split, and the pattern row also contains the file name of the destination for that specific piece. Here is an example:
... (2 Replies)
Discussion started by: cul8er
2 Replies
9. Shell Programming and Scripting
Hi all,
First of all I' like to mention that I'm pretty new to unix scripting. :(
I'm trying to split an large xml with awk and rename it based on the values of two attributes.
Example XML
<RECORD>
<element1>11</element1>
<element2>22</element2>
<element3>33</element3>... (18 Replies)
Discussion started by: f0usk4s
18 Replies
10. UNIX for Beginners Questions & Answers
I need to split the incoming source file in to multiple files using awk.
Split position is (6,13) : 8 positions
All the records that are greater than 20170101 and less than or equal to 20181231 should go in a split file with file name as source... (11 Replies)
Discussion started by: rosebud123
11 Replies
LEARN ABOUT LINUX
service
service(8) System Manager's Manual service(8)
NAME
service - run a System V init script
SYNOPSIS
service SCRIPT COMMAND [OPTIONS]
service --status-all
service --help | -h | --version
DESCRIPTION
service runs a System V init script in as predictable environment as possible, removing most environment variables and with current working
directory set to /.
The SCRIPT parameter specifies a System V init script, located in /etc/init.d/SCRIPT. The supported values of COMMAND depend on the
invoked script, service passes COMMAND and OPTIONS it to the init script unmodified. All scripts should support at least the start and
stop commands. As a special case, if COMMAND is --full-restart, the script is run twice, first with the stop command, then with the start
command.
service --status-all runs all init scripts, in alphabetical order, with the status command.
EXIT CODES
service calls the init script and returns the status returned by it.
FILES
/etc/init.d
The directory containing System V init scripts.
ENVIRONMENT
LANG, TERM
The only environment variables passed to the init scripts.
SEE ALSO
/etc/init.d/skeleton,
update-rc.d(8),
init(8),
invoke-rc.d(8).
Jan 2006 service(8)