Lurker News

Comments (144) 66 threads

Earlier comments
Johnie2 replies#
On your main screen, make the example editable. It would be nice to be able to just enter into the green box to see how it works rather than have to click through the "Get Started"

Also, your instructions makes it seem like the example is editable:
SUPER EASY TO USE 1. Paste your source data in the white box on the left.
2. Type in the green box on the right how you would like the first line of your data to look.
3. Transformy will look at your example and transform every line from your source data into the same format.

createmyaccount#
You're right that our instructions make it seem like the examples are editable. We'll work on that. Thanks for your feedback!
vijayrawatsan#
+1
Rangi422 replies#
This is a great idea! It didn't behave the way I expected with some URLs as input, though:

    http://example1.org/path/index.html
    http://www.example2.org/path/index.html
    http://www.example3.org/
    https://www.example4.org/a/b/c/d/e/f/g/hijklmnop
The pattern I gave was:

    example1.org, path/index.html
So I expected to get:

    example1.org, path/index.html
    www.example2.org, path/index.html
    www.example3.org,
    www.example4.org, a/b/c/d/e/f/g/hijklmnop
Instead, I got:

    example1.org, path/index.html
    wwwexample.2, org/path.index
    wwwexample.3, org/.
    wwwexample.4, org/a.b
A few feature requests: allow downloading the output as a text file; show a pseudo-code formula of how transformy interpreted the transformation, like "s/.+:\/\/(.+?)\/(.*)/\1, \2/"; and add support for common arbitrary transformations like "November"↔"NOV"↔"11", or "2"↔"2nd".
kbenson#
I think it's trying to be too magical. At this point it either seems to work, or something triggers it's pattern matching wrong and it's really hard to figure out what or why. I think giving back a little of the simpleness in favor of more control is worthwhile. For example, if the example portions that were formatting were differentiated from the data matching, it's not too complicated but intent is much clearer.

For example, if the rules were: example content must be contained within braces, and any braces within the example content need to be escaped, it's clear. At that point, your example becomes:

  {example1.org}, {path/index.html}
It would still probably just return "wwwexample.4, g/hijklmnop" for the last example though, because it's ambiguous as to whether you want just the end of the url, or the whole thing. Allowing regex markup for more explicit matching would make it clearer still, but your example still causes problems until you go all the way to positive lookbehind assertions. At that point I need to learn all that, I might as well just use perl:

  # perl -pe 's{.*https?://([^/]+)(/\S*).*}{$1, $2}' /tmp/foo
  example1.org, /path/index.html
  www.example2.org, /path/index.html
  www.example3.org, /
  www.example4.org, /a/b/c/d/e/f/g/hijklmnop
kazinator#
TXR language:

   @(repeat)
   @proto://@domain/@path
   @(do (put-line `@domain, @path`))
   @(end)
createmyaccount2 replies#
Amongst other things this can be used for cleaning tables/lists from special characters, changing date formats and creating xml or json.

Feedback and suggestions are very much welcome! We plan on adding a few more features soon as right now it is fairly basic but would like to hear some opinions and see if there's people out there that have a use for this.

thehoff6 replies#
This is really neat! Any chance this will be a cli tool or module/library?

It doesn't seem to play will with something like this as an input:

    3, Roberto/Carlos, soccer, Brazil
    35, Roberto/Carlos Michael Jordan, baseball, USA
    6, Roberto/Carlos James Lebron, basketball, USA
    10, Roberto/Carlos Shinji Kagawa, soccer, Japan
Format:

    3, ROBERTO/CARLOS, soccer, Brazil
Gives me:

    3, ROBERTO/CARLOS, soccer, Brazil
    35, ROBERTO/CARLOS, Michael, Jordan
    6, ROBERTO/CARLOS, James, Lebron
    10, ROBERTO/CARLOS, Shinji, Kagawa
I can't seem to find a way to get it to parse that out properly (playing with the ROBERTO/CARLOS part.

I even tried this as an input:

    3, Roberto Carlos, soccer, Brazil
    35, Roberto Carlos Michael Jordan, baseball, USA
    6, Roberto Carlos James Lebron, basketball, USA
    10, Roberto Carlos Shinji Kagawa, soccer, Japan
Format:

    3, ROBERTO CARLOS, soccer, Brazil
Gives me:

    3, ROBERTO CARLOS, soccer, Brazil
    35, ROBERTO CARLOS, Michael, Jordan
    6, ROBERTO CARLOS, James, Lebron
    10, ROBERTO CARLOS, Shinji, Kagawa
Edit: format
sp3321 reply#
My brain doesn't understand what you're trying to do either. Why is Roberto/Carlos on every line?
thehoff1 reply#
I formatted their examples to appear like some real data I have that appears like this, obviously not names but descriptions of some projects. I was curious how this would handle it.

In any case, get rid of the "/" and its closer to real. Some people have more than two names in their full name. And on a set a little larger you could very well have something close to my second example.

Continue this thread — 1 reply

pbhjpbhj1 reply#
Given this "35, Roberto/Carlos Michael Jordan, baseball, USA" tuple what are you expecting as output?
thehoff1 reply#
I was expecting that as the output but got: 35, ROBERTO/CARLOS, Michael, Jordan

See other response as it works on word by word. Here is (hopefully) a better example:
Input:

    35, Billy Jean, soccer, USA
    29, Billy Jo Jean, football, USA
Transform-at:

    35, soccer, Billy Jean, USA
You'll get:

    35, soccer, Billy Jean, USA
    29, Jean, Billy Jo, football
But I was expecting:

    35, soccer, Billy Jean, USA
    29, football, Billy Jo Jean, USA

Continue this thread — 1 reply

jschwartzi#
I thought that a cli version might be useful too. The closest thing I have right now is sed/awk. Sed can do this kind of stuff but you have to specify a Regular Expression instead of a simple example. Because you have to be more specific about what you want, Sed will definitely handle those examples, with the caveat that you have to tell Sed what it is that you want to substitute and where for each line.

http://linux.die.net/abs-guide/x19673.html
It took me about a year of use before I could figure out how to munge lines in it, so it's definitely not for the faint of heart. I use it for things like transforming excel spreadsheets into C struct arrays.

fastball#
Why would it work? Your data isn't even isomorphic.

On the first line, you have "Roberto Carlos" followed immediately by a comma. On subsequent lines you have Roberto Carlos followed by two other names.
Also your example works fine if you use a different delimiter for your format vs for your input, e.g.

  3 | ROBERTO CARLOS | SOCCER | Brazil
TuringTest1 reply#
Does it work by a general library for learning patterns, or as a collection of heuristics to match common cases?

That difference would change the kind of examples I would try it with, knowing in advance when they're too complex to work.

kogrem#
Currently there's no real machine learning or advanced pattern matching involved. But we're certainly working towards that!
sytelus3 replies#
Good concept but doesn't work. Example, type different variations of legal well formatted addresses.

  1 Microsoft Way Apt 43, Redmond, WA 98065, U.S.A.
  1-1/4 Palm Hwy, Colino, MA 87009, USA
  500 Potasium Cloride, Sunshite-Big Blow City, PA 30000, United States of America
First line output should look like:

  1 Redmond 98065 U.S.A.
Also having country-specific obscure sports terminology on landing page example can cause lot of confusion.
frevd#
Right, marking areas (in this case terms between commas), like Google's Webmaster Tools structured information designer does it, would help. This would require some kind of regular expressions in the example, at least. Of course this would make matters more complicated. This tool excels at simple data sets, I don't think it is meant to be universal.
createmyaccount#
We intend to support this in future versions but haven't gotten to it yet. It makes things a little more complicated.

Load more comments