Welcome Guest.   Make a donation to an author on the site November 20, 2009, 11:38:35 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
View the new Member Awards and Badges page.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Split .txts into smaller ones when there is a space line  (Read 1728 times)
alogoc
Supporting Member
**
Posts: 19


see users location on a map View Profile Give some DonationCredits to this forum member
« on: August 27, 2009, 04:47:44 AM »

Hello donation coders

I am looking for a program that will split .txts into smaller ones.
Now how to know how to split?
Well it will now by the space line.The only thing i want is not to move the spaced line into the created .txts


I am a bit in a hurry for this,so anyone how can make it for me will really appreciated and donated  smiley

Waiting for your answers,please don't hesitate to ask for more information if you need
Logged
skwire
Charter Member
***
Posts: 805



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #1 on: August 27, 2009, 05:07:49 AM »

Given a text file like this:

[copy or print]
Lorem ipsum dolor sit amet consectetuer tincidunt adipiscing.
Aenean eget Vestibulum metus Sed Donec nibh.

Interdum id pellentesque Integer sodales.
Tincidunt vel Nulla porttitor Sed convallis cursus.
Mauris Vestibulum nec justo consequat leo quis libero ornare.
Accumsan Aliquam lorem feugiat at tincidunt.

Interdum Vestibulum.
Parturient.
Tellus.

You want three new text files created like this:

Text file #1:
[copy or print]
Lorem ipsum dolor sit amet consectetuer tincidunt adipiscing.
Aenean eget Vestibulum metus Sed Donec nibh.

Text file #2:
[copy or print]
Interdum id pellentesque Integer sodales.
Tincidunt vel Nulla porttitor Sed convallis cursus.
Mauris Vestibulum nec justo consequat leo quis libero ornare.
Accumsan Aliquam lorem feugiat at tincidunt.

Text file #3:
[copy or print]
Interdum Vestibulum.
Parturient.
Tellus.

Is this correct?
Logged

alogoc
Supporting Member
**
Posts: 19


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #2 on: August 27, 2009, 05:12:16 AM »

Yes my friend,and don't worry about the naming,i have a rename tool  smiley
Logged
skwire
Charter Member
***
Posts: 805



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #3 on: August 27, 2009, 05:52:01 AM »

Successive blank lines are to be considered as one, correct?
Logged

alogoc
Supporting Member
**
Posts: 19


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #4 on: August 27, 2009, 06:23:55 AM »

What do you mean by considered as one? tellme
Logged
skwire
Charter Member
***
Posts: 805



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #5 on: August 27, 2009, 07:15:11 AM »

Give this a shot (source/binary included):  http://skwire.dcmembers.c...tter/Newline_Splitter.zip



« Last Edit: August 27, 2009, 07:20:52 AM by skwire » Logged

alogoc
Supporting Member
**
Posts: 19


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #6 on: August 27, 2009, 07:46:08 AM »

Hey!!Works perfectly!Thanks a lot!:)
Logged
skwire
Charter Member
***
Posts: 805



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #7 on: August 27, 2009, 07:58:53 AM »

You're welcome.  Great to hear.  =]
Logged

pulphero
Supporting Member
**
Posts: 1

View Profile Give some DonationCredits to this forum member
« Reply #8 on: September 27, 2009, 04:12:11 PM »

Would it be hard to modify this script so the user can specify the 'split target'?

For example, rather than split at blank lines, have it split at every instance of '=========='. I could then insert that string into the main text file wherever I want it to split, such as at the beginning of a section, a chapter, etc. Thanks!
Logged
tmpusr
Member
**
Posts: 117


Instantiation stuck in meatspace with no backup

View Profile Give some DonationCredits to this forum member
« Reply #9 on: September 27, 2009, 04:19:51 PM »

Could you extend it to handle this case:

http://www.donationcoder....18984.msg170283#msg170283
Logged
skwire
Charter Member
***
Posts: 805



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #10 on: September 28, 2009, 05:21:55 AM »

Would it be hard to modify this script so the user can specify the 'split target'?

For example, rather than split at blank lines, have it split at every instance of '=========='. I could then insert that string into the main text file wherever I want it to split, such as at the beginning of a section, a chapter, etc. Thanks!

I have this almost done.  As usual, I'm struggling to come up with a name for it.  At this point, I have "Text File Cracker."   Grin  Can any of you all think of anything better?  <looks squarely at cranioscopical>
Logged

skwire
Charter Member
***
Posts: 805



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #11 on: September 28, 2009, 05:24:37 AM »

Could you extend it to handle this case:

http://www.donationcoder....18984.msg170283#msg170283

I think your requirements might be a bit out of scope for a simple text file cracker like this.  That being said, I promise to take a deeper look at your request.
Logged

cranioscopical
Friend of the Site
Supporting Member
**
Posts: 1,941



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #12 on: September 28, 2009, 06:04:30 AM »

I have this almost done.  As usual, I'm struggling to come up with a name for it.  At this point, I have "Text File Cracker."   Grin  Can any of you all think of anything better?  <looks squarely at cranioscopical>
No pressure,  eh?  smiley

Chopping List?
Subtext?
Textarian?
ReTextChewer?
Lickety-split?
Logged

Chris
skwire
Charter Member
***
Posts: 805



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #13 on: September 28, 2009, 06:18:47 AM »

Hahaha...I like "Chopping List" and I have the perfect icon for it:

http://www.iconarchive.co...attahan/Hatchet-icon.html

Winner!  Winner!  Chicken dinner!
Logged

skwire
Charter Member
***
Posts: 805



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #14 on: September 28, 2009, 07:35:01 AM »

v1.0.1 - 2009-09-28
    + Added ability to specify a custom delimiter to split on.  (Thanks, pulphero)
    * Changed application name to "Chopping List."  (Thanks, cranioscopical)

Website | Download



I've done only minimal testing so feedback is required.  There will be a quiz in the morning.   cheesy
Logged

cranioscopical
Friend of the Site
Supporting Member
**
Posts: 1,941



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #15 on: September 28, 2009, 08:03:46 AM »

Hahaha...I like "Chopping List" and I have the perfect icon for it:

http://www.iconarchive.co...attahan/Hatchet-icon.html

Winner!  Winner!  Chicken dinner!
Then you might like Text TriceChopper  smiley
Logged

Chris
skwire
Charter Member
***
Posts: 805



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #16 on: September 28, 2009, 08:13:39 AM »

Chopping List with the hatchet icon is just too perfect.   Cool
Logged

tmpusr
Member
**
Posts: 117


Instantiation stuck in meatspace with no backup

View Profile Give some DonationCredits to this forum member
« Reply #17 on: September 28, 2009, 08:58:50 AM »

I think your requirements might be a bit out of scope for a simple text file cracker like this.  That being said, I promise to take a deeper look at your request.

I appreciate that. How I envision using the Tag and Split function is

1 Creating a list of tags text file.
2 Adding the tags in front of paragraphs - like \a \b \c - just boom boom boom - that perhaps get substituted to [Topic A] [Topic B] [Topic C].
3 Running Chopping List and getting as many files as there are tags.
4 Continuing editing with all the topics neatly in their own files.

Useful for organizing any kind of text where various topics/ideas have been collected in one file. Certainly n times more efficient and quicker than cut-pasting between text files, which lacks the boom boom boomness that I'm looking for here.

There's a feature for sorting paragraphs in Word, but it fails when there is more than one paragraph before the next tag.

The best software has the least steps between beginning and achieving the goal, ideally: Boom, you're done. And after that the process should be automated if possible so you never have to repeat even that single boom*.

(*meme courtesy of Steve 'Boom' Jobs)
« Last Edit: September 28, 2009, 09:17:46 AM by tmpusr » Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
SMF © 2006-2009, Simple Machines LLC

social bookmark this page