Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all! We have been experiencing an issue on site where threads have been missing the latest postings. The platform host Vanilla are working on this issue. A workaround that has been used by some is to navigate back a page or two to re-sync the thread and this will then show latest posts. Thanks, Mike.

Splitting a txt file?

Comments

  • Registered Users, Registered Users 2 Posts: 648 ✭✭✭Tenshot


    Download and install copy of ActivePerl for Windows here.

    Then create a file called convert.pl with the following:
    while (<>)
    {
    	m/\s*([^\s]*)\s*(.*)/;
    	if (open FOUT, ">$1")
    	{
    		print FOUT "$2\n";
    		close FOUT;
    	}
    	else
    	{
    		print "Warning: can't create output file $1\n";
    	}
    }
    
    Finally, to run it, type at a command prompt:
    perl convert.pl <yourfile.txt
    
    and it will convert it into 1000 smaller files the way you described.


  • Closed Accounts Posts: 756 ✭✭✭Zaph0d


    ...or else just type this at a command prompt...
    FOR /F "tokens=1,2*" %G IN (BIGFILE.txt) DO @echo %H %I>%G
    


  • Closed Accounts Posts: 10,921 ✭✭✭✭Pigman II


    Thanks for those suggestions everyone


Advertisement