Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • September 02, 2015, 11:56:24 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: DONE: Split .txts into smaller ones when there is a space line  (Read 14554 times)

alogoc

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 19
    • View Profile
    • Donate to Member
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  :)

Waiting for your answers,please don't hesitate to ask for more information if you need

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 4,393
    • View Profile
    • Donate to Member
Re: Split .txts into smaller ones when there is a space line
« Reply #1 on: August 27, 2009, 06:07:49 AM »
Given a text file like this:

Code: [Select]
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:
Code: [Select]
Lorem ipsum dolor sit amet consectetuer tincidunt adipiscing.
Aenean eget Vestibulum metus Sed Donec nibh.

Text file #2:
Code: [Select]
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:
Code: [Select]
Interdum Vestibulum.
Parturient.
Tellus.

Is this correct?

alogoc

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 19
    • View Profile
    • Donate to Member
Re: Split .txts into smaller ones when there is a space line
« Reply #2 on: August 27, 2009, 06:12:16 AM »
Yes my friend,and don't worry about the naming,i have a rename tool  :)

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 4,393
    • View Profile
    • Donate to Member
Re: Split .txts into smaller ones when there is a space line
« Reply #3 on: August 27, 2009, 06:52:01 AM »
Successive blank lines are to be considered as one, correct?

alogoc

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 19
    • View Profile
    • Donate to Member
Re: Split .txts into smaller ones when there is a space line
« Reply #4 on: August 27, 2009, 07:23:55 AM »
What do you mean by considered as one? :tellme:

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 4,393
    • View Profile
    • Donate to Member
Re: Split .txts into smaller ones when there is a space line
« Reply #5 on: August 27, 2009, 08:15:11 AM »
Give this a shot (source/binary included):  http://skwire.dcmemb...Newline_Splitter.zip

2009-08-27_081834.png

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

alogoc

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 19
    • View Profile
    • Donate to Member
Re: Split .txts into smaller ones when there is a space line
« Reply #6 on: August 27, 2009, 08:46:08 AM »
Hey!!Works perfectly!Thanks a lot!:)

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 4,393
    • View Profile
    • Donate to Member
Re: Split .txts into smaller ones when there is a space line
« Reply #7 on: August 27, 2009, 08:58:53 AM »
You're welcome.  Great to hear.  =]

pulphero

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 15
    • View Profile
    • Donate to Member
Re: Split .txts into smaller ones when there is a space line
« Reply #8 on: September 27, 2009, 05: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!

tmpusr

  • Member
  • Joined in 2005
  • **
  • Posts: 154
  • Instantiation stuck in meatspace with no backup
    • View Profile
    • Donate to Member
Re: Split .txts into smaller ones when there is a space line
« Reply #9 on: September 27, 2009, 05:19:51 PM »
Could you extend it to handle this case:

http://www.donationc....msg170283#msg170283

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 4,393
    • View Profile
    • Donate to Member
Re: Split .txts into smaller ones when there is a space line
« Reply #10 on: September 28, 2009, 06: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."   ;D  Can any of you all think of anything better?  <looks squarely at cranioscopical>

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 4,393
    • View Profile
    • Donate to Member
Re: Split .txts into smaller ones when there is a space line
« Reply #11 on: September 28, 2009, 06:24:37 AM »
Could you extend it to handle this case:

http://www.donationc....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.

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,302
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Split .txts into smaller ones when there is a space line
« Reply #12 on: September 28, 2009, 07: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."   ;D  Can any of you all think of anything better?  <looks squarely at cranioscopical>
No pressure,  eh?  :)

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

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 4,393
    • View Profile
    • Donate to Member
Re: Split .txts into smaller ones when there is a space line
« Reply #13 on: September 28, 2009, 07:18:47 AM »
Hahaha...I like "Chopping List" and I have the perfect icon for it:

http://www.iconarchi...an/Hatchet-icon.html

Winner!  Winner!  Chicken dinner!

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 4,393
    • View Profile
    • Donate to Member
Re: Split .txts into smaller ones when there is a space line
« Reply #14 on: September 28, 2009, 08: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

main.pngDONE: Split .txts into smaller ones when there is a space line

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

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,302
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Split .txts into smaller ones when there is a space line
« Reply #15 on: September 28, 2009, 09:03:46 AM »
Hahaha...I like "Chopping List" and I have the perfect icon for it:

http://www.iconarchi...an/Hatchet-icon.html

Winner!  Winner!  Chicken dinner!
Then you might like Text TriceChopper  :)

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 4,393
    • View Profile
    • Donate to Member
Re: Split .txts into smaller ones when there is a space line
« Reply #16 on: September 28, 2009, 09:13:39 AM »
Chopping List with the hatchet icon is just too perfect.   8)

tmpusr

  • Member
  • Joined in 2005
  • **
  • Posts: 154
  • Instantiation stuck in meatspace with no backup
    • View Profile
    • Donate to Member
Re: Split .txts into smaller ones when there is a space line
« Reply #17 on: September 28, 2009, 09: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, 10:17:46 AM by tmpusr »

nkormanik

  • Participant
  • Joined in 2010
  • *
  • default avatar
  • Posts: 299
    • View Profile
    • Donate to Member
Re: DONE: Split .txts into smaller ones when there is a space line
« Reply #18 on: March 06, 2012, 08:07:55 PM »
Enhancement Request:

When creating the text files from a block of copied text (say from your ClipTrap) please give the option of including x number of padded zeros in front of numbers.

For instance:

Pad to three digits....

001
002
003
.
.
017
018

Thank you for a super program!

Nicholas


skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 4,393
    • View Profile
    • Donate to Member
Re: DONE: Split .txts into smaller ones when there is a space line
« Reply #19 on: March 06, 2012, 08:40:03 PM »
I think that is outside the scope of the application.  However, you may be able to leverage my List Numberer program to do what you want.

nkormanik

  • Participant
  • Joined in 2010
  • *
  • default avatar
  • Posts: 299
    • View Profile
    • Donate to Member
Re: DONE: Split .txts into smaller ones when there is a space line
« Reply #20 on: March 07, 2012, 05:21:30 PM »
But, but, but....

Automatically adding those padded zeros ahead of numbers would make things a bit easier.

Pretty please???


skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 4,393
    • View Profile
    • Donate to Member
Re: DONE: Split .txts into smaller ones when there is a space line
« Reply #21 on: March 07, 2012, 11:11:36 PM »
Doh, I went back and re-read your request and now I understand what you were asking for.  Sorry about that.   :-[  Here you go:

Website | Download
v1.0.3 - 2012-03-07
    + Option to specify number of leading zeros to pad filenames with. (Thanks, nkormanik)

nkormanik

  • Participant
  • Joined in 2010
  • *
  • default avatar
  • Posts: 299
    • View Profile
    • Donate to Member
Re: DONE: Split .txts into smaller ones when there is a space line
« Reply #22 on: March 10, 2012, 04:51:24 PM »
Fantastic, Skwire, that cuts out a step in the process -- using a third-party software renamer to add in the zero-padding.

Well done!