Hi,
I have a requirement like this.
String=abcdefghijkl
I need to split this string into a substrign each 3 characters and write output into a file.
Output:
abc
def
ghi
jkl
Can any one please help me how can i acheive this
Thanks (3 Replies)
Hello all.
Sorry, I know this question is similar to many others, but I just can seem to put together exactly what I need.
My file is tab delimitted and contains approximately 1 million rows. I would like to send lines 1,4,& 7 to a file. Lines 2, 5, & 8 to a second file. Lines 3, 6, & 9 to... (11 Replies)
Dear All,
I would like to split a file of the following format into multiple files based on the number in the 6th column (numbers 1, 2, 3...):
ATOM 1 N GLY A 1 -3.198 27.537 -5.958 1.00 0.00 N
ATOM 2 CA GLY A 1 -2.199 28.399 -6.617 1.00 0.00 ... (3 Replies)
I am getting a few gzip files into a folder by doing ftp to another server. Once I get them I move them to another location .But before that I need to make sure each gzip is not more than 5000 lines and split it up . The files I get are anywhere from 500 lines to 10000 lines in them and is in gzip... (4 Replies)
Hello Friends,
Can anyone help me for the below requirement.
I am having a file called Input.txt.
My requirement is first check the count that is wc -l input.txt
If the result of the wc -l Input.txt is less than 10 then don't split the Input.txt file. Where as if Input.txt >= 10 the split... (12 Replies)
I have a requirement to split a huge file to smaller text files based on first four characters which look like
ABCD
1234
DFGH
RREX
:
:
:
:
:
0000
Each of these records are OF EQUAL bytes with a different internal layout based on the above first digit identifier..
Any help to start... (5 Replies)
hi Gurus,
I need separate a file which is one huge line to multiple lines based on certain number of charactors. for example:
abcdefghi high abaddffdd
I want to separate the line to multiple lines for every 4 charactors.
the result should be
abcd
efgh
i hi
gh a
badd
ffdd
Thanks in... (5 Replies)
Hi
i have requirement like below
M <form_name> sdasadasdMklkM
D ......
D .....
M form_name> sdasadasdMklkM
D ......
D .....
D ......
D .....
M form_name> sdasadasdMklkM
D ......
M form_name> sdasadasdMklkM
i want split file based on line number by finding... (10 Replies)
Hello All ,
I have a file which needs to split based on the blank lines
Name ABC
Address London
Age 32
(4 blank new line)
Name DEF
Address London
Age 30
(4 blank new line)
Name DEF
Address London (8 Replies)
Hi
I have a requirement, where i will receive multiple files in a folder (say: /fol1/fol2/). There will be at least 14 to 16 files. The size of the files will different, some may be 80GB or 90GB, some may be less than 5 GB (and the size of the files are very unpredictable). But the names of the... (10 Replies)
Discussion started by: kpk_ds
10 Replies
LEARN ABOUT CENTOS
io::lines
IO::Lines(3) User Contributed Perl Documentation IO::Lines(3)NAME
IO::Lines - IO:: interface for reading/writing an array of lines
SYNOPSIS
use IO::Lines;
### See IO::ScalarArray for details
DESCRIPTION
This class implements objects which behave just like FileHandle (or IO::Handle) objects, except that you may use them to write to (or read
from) an array of lines. They can be tiehandle'd as well.
This is a subclass of IO::ScalarArray in which the underlying array has its data stored in a line-oriented-format: that is, every element
ends in a "
", with the possible exception of the final element. This makes "getline()" much more efficient; if you plan to do line-
oriented reading/printing, you want this class.
The "print()" method will enforce this rule, so you can print arbitrary data to the line-array: it will break the data at newlines
appropriately.
See IO::ScalarArray for full usage and warnings.
VERSION
$Id: Lines.pm,v 1.3 2005/02/10 21:21:53 dfs Exp $
AUTHORS
Primary Maintainer
David F. Skoll (dfs@roaringpenguin.com).
Principal author
Eryq (eryq@zeegee.com). President, ZeeGee Software Inc (http://www.zeegee.com).
Other contributors
Thanks to the following individuals for their invaluable contributions (if I've forgotten or misspelled your name, please email me!):
Morris M. Siegel, for his $/ patch and the new "getlines()".
Doug Wilson, for the IO::Handle inheritance and automatic tie-ing.
perl v5.16.3 2005-02-10 IO::Lines(3)