DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: better than textmechanic  (Read 6,781 times)

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
better than textmechanic
« on: March 30, 2015, 01:52 PM »
hello

do you know any website, or maybe create one! that will be better than textmechanic?

it has really useful tools, but it doesn't cover all the possible situations

for example, it doesn't have a function to convert a list of object1, object2, object3, into a vertical list, etc

I would also like to be able to create all the possible combinations between 2 or 3 lists of strings

etc

any idea?

thanks!

Edvard

  • Coding Snacks Author
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 3,027
    • Participated in NANY Challenge Once
    • Coding Snacks
    • Linux User
Re: better than textmechanic
« Reply #1 on: March 31, 2015, 03:07 AM »
For the first request, not a website, but a command-line tool.

Sedw:
Quote
sed (stream editor) is a Unix utility that parses and transforms text, using a simple, compact programming language.

You want a comma-separated list transformed into a vertical list?
Code
sed 's/, /\n/g' comma_list.txt > vert_list.txt

Sed for windows can be found here: http://gnuwin32.sourceforge.net/packages/sed.htm

The combinations of strings will have to be done as a programming exercise.  Eric Lippert, a C# compiler dev for Microsoft, has an interesting, though kinda technical, series on just such a thing which is known as Context-Free Grammar which is important in the design of programming languages.  Don't know if it'll help at all, but I couldn't do any better.
http://blogs.msdn.com/b/ericlippert/archive/2010/04/26/every-program-there-is-part-one.aspx
All children left unattended will be given a mocha and a puppy.

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
Re: better than textmechanic
« Reply #2 on: March 31, 2015, 06:27 AM »
In Powershell:
Code: ( powershell)
$a = Get-Content comma_list.txt ; $a.Split(",") >> vert_list.txt

For word permutations in Powershell, see here.
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903
« Last Edit: September 01, 2015, 02:32 AM by 4wd »

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
Re: better than textmechanic
« Reply #3 on: March 31, 2015, 11:52 AM »
thanks!
as for the latter? to generate all the possible combinations of two lists of strings?

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
Re: better than textmechanic
« Reply #4 on: March 31, 2015, 05:10 PM »
also guys, I need this to work in any pc, that's why I want it in a website and not in a script

4wd

  • Pedantic Old Bastard
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,652
    • Coding Snacks
Re: better than textmechanic
« Reply #5 on: April 01, 2015, 12:25 AM »
"I will not follow where the path may lead, but I will go where there is no path, and I will leave a trail." - Muriel Strode, 1903

sifu99

  • Supporting Member
  • Joined in 2015
  • **
  • Posts: 9
Re: better than textmechanic
« Reply #6 on: April 01, 2015, 11:13 AM »
String Splitting
Great find. Thanks.
I especiallly love its link to grepyy.com  :)

Original address: https://www.donationcoder.com/forum/index.php?topic=40550.0