CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Splitting a text file

 



ragha12
Novice

Sep 13, 2011, 4:49 AM

Post #1 of 8 (853 views)
Splitting a text file Can't Post

Hi,
Please tell me how to split a text file to number of text files ......

Anyone help me please.....

Thank you...Unimpressed


rovf
Veteran

Sep 14, 2011, 3:05 AM

Post #2 of 8 (823 views)
Re: [ragha12] Splitting a text file [In reply to] Can't Post

Where exactly are you stuck?

Is this a Perl-Question, or is it a general programming question?

What platform are you using?


ragha12
Novice

Sep 14, 2011, 3:20 AM

Post #3 of 8 (821 views)
Re: [rovf] Splitting a text file [In reply to] Can't Post

Ya perl only....


rovf
Veteran

Sep 14, 2011, 3:30 AM

Post #4 of 8 (819 views)
Re: [ragha12] Splitting a text file [In reply to] Can't Post

Well, this answers already one of the three questions I asked you. So someday you will answer the other ones as well? ;-)


ragha12
Novice

Sep 14, 2011, 3:59 AM

Post #5 of 8 (817 views)
Re: [rovf] Splitting a text file [In reply to] Can't Post

i am using strawbery perl, editor is perl experss

use strict;
use warnings;
my $table;

open(DAT, 'mbsfact.txt');
$table=<DAT>;


i am opening this file and i have split this text into no of files .........how to split it?


rovf
Veteran

Sep 14, 2011, 4:50 AM

Post #6 of 8 (814 views)
Re: [ragha12] Splitting a text file [In reply to] Can't Post

With "platform", I mean the operating system. Strawberry Perl can be used on Linux, Mac, and Windoze. Depending on the OS, you might already find on your system useful tools to split a file, which you could use from your Perl application.

In your previous reply, you said that this is not a programming question, but a Perl specific question, so maybe you write (just in plain English) the algorithm you are going to implement, and then we can help you to express it in Perl.


ragha12
Novice

Sep 14, 2011, 9:28 PM

Post #7 of 8 (797 views)
Re: [rovf] Splitting a text file [In reply to] Can't Post

Windows XP......

after opening the file ow to split that text file......


Unimpressed


rovf
Veteran

Sep 15, 2011, 2:51 AM

Post #8 of 8 (770 views)
Re: [ragha12] Splitting a text file [In reply to] Can't Post

What exactly do you mean by "split after opening"? Do you mean creating new files (each containing part of the original file)? Do you mean replacing the original file by 351 new files, each containing a 351th part of the original file? Do you mean processing a file by splitting, so that part of the file is processed in one way and part is processed in a different way?

Please be more precise.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives