09-28-2005
split function
Hi all!
I am relatively new to UNIX staff, and I have come across a problem:
I have a big directory, which contains 100 smaller ones. Each of the 100 contains a file ending in .txt , so there are 100 files ending in .txt
I want to split each of the 100 files in smaller ones, which will contain 2000 lines each.
I think that 'split' command is what I must use, but I don't know how.
I go something like:
find . -name "*.txt" | .....
Any hints on the missing part? How can I apply the split command in each file, without entering each directory?
Thanx
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
$mystring = "name:blk:house::";
print "$mystring\n";
@s_format = split(/:/, $mystring);
for ($i=0; $i <= $#s_format; $i++) {
print "index is $i,field is $s_format";
print "\n";
}
$size = $#s_format + 1;
print "total size of array is $size\n";
i am expecting my size to be 5, why is it... (5 Replies)
Discussion started by: new2ss
5 Replies
2. Shell Programming and Scripting
Hi,
I have some output in the form of:
#output:
abc123
def567
hij890
ghi324
the above is in one column, stored in the variable x ( and if you wana know about x... x=sprintf(tolower(substr(someArray,1,1)substr(userArray,3,1)substr(userArray,2,1)))
when i simply print x (print x) I get... (7 Replies)
Discussion started by: fusionX
7 Replies
3. Shell Programming and Scripting
Hello,
if i have file like this:
010000890306932455804 05306977653873 0520080417010520ISMS SMT ZZZZZZZZZZZZZOC30693599000 30971360000 ZZZZZZZZZZZZZZZZZZZZ202011302942311 010000890306946317387 05306977313623 0520080417010520ISMS SMT ZZZZZZZZZZZZZOC306942190000 30971360000... (5 Replies)
Discussion started by: chriss_58
5 Replies
4. Shell Programming and Scripting
Hi! I'm doing bash shell scripting and would like to know if bash had something similar to perl's split function? Ultimately, I want to split two strings (delimeter = '.') and compare each of their values. Thus, I figured putting them in an array would be easiest.
So i.e.:
String 1:... (5 Replies)
Discussion started by: eur0dad
5 Replies
5. UNIX for Dummies Questions & Answers
Hello,
Hello,
I use the following command to split a file:
split -Number_of_Lines Input_File MyPrefix_
output is
MyPrefix_a
MyPrefix_b
MyPrefix_c
......
Instead, how can I get numerical values like:
MyPrefix_1
MyPrefix_2
MyPrefix_3
...... (2 Replies)
Discussion started by: Gussifinknottle
2 Replies
6. Homework & Coursework Questions
Hi... I have a question regarding the split function in PERL.
I have a very huge csv file (more than 80 million records). I need to extract a particular position(eg : 50th position) of each line from the csv file. I tried using split function. But I realized split takes a very long time.
Also... (1 Reply)
Discussion started by: castle
1 Replies
7. Homework & Coursework Questions
Hi... I have a question regarding the split function in PERL.
I have a very huge csv file (more than 80 million records). I need to extract a particular position(eg : 50th position) of each line from the csv file. I tried using split function. But I realized split takes a very long time.
Also... (0 Replies)
Discussion started by: castle
0 Replies
8. Shell Programming and Scripting
Hi... I have a question regarding the split function in PERL.
I have a very huge csv file (more than 80 million records). I need to extract a particular position(eg : 50th position) of each line from the csv file. I tried using split function. But I realized split takes a very long time.
Also... (1 Reply)
Discussion started by: castle
1 Replies
9. Shell Programming and Scripting
my @d =split('\|', $_);
west|ACH|3|Y|LuV|N||N||
Qt|UWST|57|Y|LSV|Y|Bng|N|KT|
It Returns d as 8 for First Line, and 9 as for Second Line . I want to Process Both the Files, How to Handle It. (3 Replies)
Discussion started by: vishwakar
3 Replies
10. Shell Programming and Scripting
hi all,
i have large file. where i need the split the files into two files. can anyone tell me what is the command for that?
Unix OS :HP Unix.
Thanks,
arun. (2 Replies)
Discussion started by: arun888
2 Replies
LEARN ABOUT DEBIAN
tm::coverage
TM::Coverage(3pm) User Contributed Perl Documentation TM::Coverage(3pm)
NAME
TM::Coverage - Topic Maps, Code Coverage
DESCRIPTION
This auxiliary package keeps track of the code coverage. Probably quite irrelevant for a user.
Automatically generated for TM (1.44).
---------------------------- ------ ------ ------ ------ ------ ------ ------
File stmt bran cond sub pod time total
---------------------------- ------ ------ ------ ------ ------ ------ ------
blib/lib/TM.pm 96.4 84.5 58.0 93.7 90.6 27.5 89.6
blib/lib/TM/Analysis.pm 100.0 90.9 n/a 100.0 100.0 0.0 97.5
blib/lib/TM/AsTMa/Fact.pm 100.0 n/a n/a 100.0 n/a 0.0 100.0
blib/lib/TM/AsTMa/Fact2.pm 100.0 n/a n/a 100.0 n/a 0.0 100.0
blib/lib/TM/Bulk.pm 76.8 71.4 62.5 85.7 100.0 0.0 75.3
blib/lib/TM/CTM/CParser.pm 65.6 34.3 31.0 84.6 0.0 1.6 52.5
blib/lib/TM/CTM/Parser.pm 90.9 50.0 n/a 100.0 0.0 0.0 79.4
blib/lib/TM/DM.pm 100.0 65.0 66.7 100.0 n/a 0.0 96.5
blib/lib/TM/Graph.pm 99.1 88.5 n/a 100.0 100.0 0.0 97.4
blib/lib/TM/Index.pm 100.0 80.0 60.0 100.0 83.3 0.3 87.8
.../Index/Characteristics.pm 100.0 100.0 n/a 100.0 0.0 0.0 97.0
blib/lib/TM/Index/Match.pm 98.5 87.5 n/a 100.0 100.0 0.5 97.6
blib/lib/TM/LTM/CParser.pm 84.9 45.3 42.7 98.2 0.0 0.2 67.8
blib/lib/TM/LTM/Parser.pm 95.7 62.5 50.0 100.0 0.0 0.0 87.1
blib/lib/TM/Literal.pm 45.8 0.0 11.8 30.0 0.0 0.4 24.2
blib/lib/TM/MapSphere.pm 96.5 84.6 68.8 100.0 100.0 0.0 91.7
.../TM/Materialized/AsTMa.pm 100.0 n/a n/a 100.0 0.0 0.0 95.5
...ib/TM/Materialized/LTM.pm 100.0 n/a n/a 100.0 0.0 0.0 95.5
.../TM/Materialized/MLDBM.pm 100.0 83.3 n/a 100.0 0.0 0.0 92.6
...b/TM/Materialized/Null.pm 100.0 n/a n/a 100.0 n/a 0.0 100.0
...TM/Materialized/Stream.pm 100.0 100.0 100.0 100.0 0.0 0.0 96.0
...ib/TM/Materialized/XTM.pm 100.0 n/a n/a 100.0 0.0 0.0 96.7
blib/lib/TM/PSI.pm 100.0 n/a n/a 100.0 n/a 0.0 100.0
blib/lib/TM/QL.pm 91.4 61.5 66.7 100.0 50.0 0.1 83.9
blib/lib/TM/QL/CParser.pm 76.2 42.4 41.9 90.3 0.0 9.1 62.0
blib/lib/TM/QL/PE.pm 83.8 77.3 80.0 91.7 0.0 52.5 80.5
blib/lib/TM/QL/TS.pm 65.2 35.4 27.8 70.8 53.3 2.4 56.9
blib/lib/TM/ResourceAble.pm 88.1 87.5 n/a 100.0 100.0 0.0 90.0
.../TM/ResourceAble/MLDBM.pm 100.0 75.0 n/a 100.0 0.0 0.0 94.2
blib/lib/TM/Serializable.pm 94.9 65.6 100.0 100.0 100.0 0.0 84.1
.../TM/Serializable/AsTMa.pm 99.1 87.9 66.7 100.0 100.0 0.0 94.2
...TM/Serializable/Dumper.pm 100.0 n/a n/a 100.0 0.0 0.0 93.5
...ib/TM/Serializable/LTM.pm 94.1 n/a n/a 83.3 100.0 0.0 92.0
...ib/TM/Serializable/XTM.pm 96.3 85.2 72.9 100.0 100.0 0.2 91.5
.../lib/TM/Synchronizable.pm 100.0 75.0 100.0 100.0 100.0 0.0 97.2
...M/Synchronizable/MLDBM.pm 100.0 50.0 n/a 100.0 0.0 0.0 89.3
...nchronizable/MapSphere.pm 100.0 63.6 64.3 100.0 100.0 0.0 88.6
...TM/Synchronizable/Null.pm 100.0 n/a n/a 100.0 0.0 0.0 87.5
blib/lib/TM/Tau.pm 100.0 91.7 80.0 100.0 0.0 0.0 95.6
blib/lib/TM/Tau/Federate.pm 63.2 39.3 n/a 62.5 27.3 0.0 54.5
blib/lib/TM/Tau/Filter.pm 100.0 91.7 66.7 100.0 50.0 0.0 90.0
.../TM/Tau/Filter/Analyze.pm 100.0 n/a n/a 100.0 100.0 0.0 100.0
blib/lib/TM/Tree.pm 100.0 57.1 44.4 100.0 66.7 0.0 88.0
blib/lib/TM/Utils.pm 100.0 50.0 n/a 100.0 0.0 0.0 89.3
...ib/TM/Utils/TreeWalker.pm 100.0 100.0 n/a 100.0 0.0 0.0 96.0
...ib/TM/Workbench/Plugin.pm 100.0 n/a n/a 100.0 0.0 0.0 75.0
...M/Workbench/Plugin/Tau.pm 87.5 50.0 n/a 80.0 0.0 0.0 73.1
yapp/astma-fact.yp 96.9 91.5 73.3 97.8 0.0 4.8 92.7
yapp/astma2-fact.yp 97.4 91.6 58.3 100.0 0.0 0.2 91.6
Total 76.8 45.2 40.2 91.2 57.0 100.0 63.8
---------------------------- ------ ------ ------ ------ ------ ------ ------
SEE ALSO
TM
COPYRIGHT AND LICENSE
Copyright 200[8] by Robert Barta, <drrho@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2008-10-05 TM::Coverage(3pm)