Welcome Guest.   Make a donation to an author on the site September 17, 2014, 10:38:40 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.
 
The N.A.N.Y. Challenge 2013! Download dozens of custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: DONE: Split .txts into smaller ones when there is a space line  (Read 12506 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, 05: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
Moderator
*****
Posts: 4,072



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #1 on: August 27, 2009, 06: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, 06:12:16 AM »

Yes my friend,and don't worry about the naming,i have a rename tool  smiley
Logged
skwire
Moderator
*****
Posts: 4,072



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #3 on: August 27, 2009, 06: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, 07:23:55 AM »

What do you mean by considered as one? tellme
Logged
skwire
Moderator
*****
Posts: 4,072



Another Coding Snack request? Om nom nom...

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

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



« Last Edit: August 27, 2009, 08: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, 08:46:08 AM »

Hey!!Works perfectly!Thanks a lot!:)
Logged
skwire
Moderator
*****
Posts: 4,072



Another Coding Snack request? Om nom nom...

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

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

pulphero
Supporting Member
**
Posts: 15

View Profile Give some DonationCredits to this forum member
« 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!
Logged
tmpusr
Member
**
Posts: 154


Instantiation stuck in meatspace with no backup

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

Could you extend it to handle this case:

http://www.donationcoder....18984.msg170283#msg170283
Logged
skwire
Moderator
*****
Posts: 4,072



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« 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."   Grin  Can any of you all think of anything better?  <looks squarely at cranioscopical>
Logged

skwire
Moderator
*****
Posts: 4,072



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #11 on: September 28, 2009, 06: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: 4,170



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« 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."   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
Moderator
*****
Posts: 4,072



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« 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.iconarchive.co...attahan/Hatchet-icon.html

Winner!  Winner!  Chicken dinner!
Logged

skwire
Moderator
*****
Posts: 4,072



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« 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



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: 4,170



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« 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.iconarchive.co...attahan/Hatchet-icon.html

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

Chris
skwire
Moderator
*****
Posts: 4,072



Another Coding Snack request? Om nom nom...

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

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

tmpusr
Member
**
Posts: 154


Instantiation stuck in meatspace with no backup

View Profile Give some DonationCredits to this forum member
« 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 » Logged
nkormanik
Participant
*
Posts: 284

View Profile Give some DonationCredits to this forum member
« 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

Logged
skwire
Moderator
*****
Posts: 4,072



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« 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.
Logged

nkormanik
Participant
*
Posts: 284

View Profile Give some DonationCredits to this forum member
« 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???

Logged
skwire
Moderator
*****
Posts: 4,072



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« 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.   embarassed  Here you go:

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

nkormanik
Participant
*
Posts: 284

View Profile Give some DonationCredits to this forum member
« 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!

Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.044s | Server load: 0.02 ]