Create a record with fixed length

M

matou

I have a file where the record that I read is over 2341 char and I
have to split to a fixed length to an another file ,

Please Help
 
J

Jürgen Exner

matou said:
I have a file where the record that I read is over 2341 char and I
have to split to a fixed length to an another file ,

Maybe "perldoc -f substr"?

jue
 
M

Martien Verbruggen

I have a file where the record that I read is over 2341 char and I
have to split to a fixed length to an another file ,

What exactly are you having trouble with?

To read a fixed length from a file, see read() (perldoc -f read). To
"split to a fixed length", probably see substr() (perldoc -f substr)),
depending on what exactly you men by that. Maybe you need unpack()? To
write to another file, use print, or maybe syswrite() if you need to
write part of your string. Of course, you'll also need to open the
existing file for read, and the target file for write (perldoc -f open,
perldoc -f close).

It's hard to tell what exactly you need, and in which order. You give
virtually no useful information.

Martien
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,173
Latest member
GeraldReund
Top