Archive for the ‘tools.perceptus.ca’ Category

Our New Web Based Whitespace Trimming Tools

Friday, October 29th, 2010

We added a couple new tools to Web Tools by Perceptus today.  We also cleaned up the look of the site a little – it’s gone all the way from ugly to almost passable.  Similar to our blog, over time, the trickle of traffic to our web based text mangling site has grown, and it had earned a bit of our effort to tidy it up. Who knows, if this keeps up, we’ll have to keep adding more tools!

The new tools?

  • The Whitespace Trimmer – Paste a blob of text. Every line  of text will be trimmed of spaces on the left and right and returned to you.
  • The Blank Line Remover – Paste a blob of text.  Every blank line will be removed.

Like the rest of the site, the clipboard is your friend.  Run one tool.  Copy the result to the clipboard, and run another one of our tools on the result.

 

 

Cross Browser Compatibility of TEXTAREA and Chrome, Firefox, and IE with CSS “white-space: nowrap;”

Monday, October 19th, 2009

Today, the Perceptus Web Tools got a minor upgrade to improve browser compatibility.

A company bought a  license to our unique Excel to SQL INSERT Commands tool for their internal, confidential, use.  Cool! We never expected tools.perceptus.ca to be a revenue generator… but it does have unique features.  After all, we wrote them because we couldn’t find another website that could do the task for us!

In the interest of delivering a nice package to our new licensee, we  noticed that many of the text mangling features did not work in Google  Chrome.  Chrome web browser was stripping line breaks and consolidating sequential “spaces”.  We then realized that the site was not working in Internet Explorer either. Whoops.  Well, it is a  site primarily for our own internal uses, after all.

We had discovered a browser compatibility issue that probably affects very few people. We want a textarea without any wrapping, because some features are based on copy and pasting large amounts of data from Excel – automatic text wrapping makes hard to read.

Our original, Firefox functional, Chrome and Internet Explorer non-functional, TEXTAREA used the following:

  • CSS: white-space: nowrap;
  • TEXTAREA attribute: WRAP=”OFF”

In Firefox, we got a nice blob of text that you can scroll horizontally displayed.  In IE7 and IE8?  All kinds of crazy.  “Enter” keys got replaced by some sort of special inline character, lines and spaces got trimmed or cut out.  Google Chrome stripped out line breaks and leading spaces, and other oddities.

Upon research, we learned that the “WRAP” attribute is not W3C approved.  Technically, it is not deprecated, but that’s because it never existed in the specifications. So we removed it and tried to use only CSS. We tried a few combinations of the overflow, white-space, and display CSS properties.  They didn’t work.

What did work?

No CSS at all.

If you view the source of the tools.perceptus.ca site and the corresponding CSS file, you will only see this:

<TEXTAREA NAME=”thetextROWS=”20COLS=”100WRAP=”OFF“>

This works as we wanted in all three web browsers.  It is officially non-standard.  But it works.

If someone would like to submit a CSS that will actually work, I’d love to see it.  But for now, I’m just going to keep complaining about how much web programming still stinks. Maybe the moral of the story is that thanks to Apple’s Safari and Google Chrome, every web site should be tested against at least one of the Webkit based browsers in addition to Firefox and Internet Explorer.

Create a single line of text from a table for logging

Monday, June 15th, 2009

Have you ever wanted to copy a chunk of text from a web page for logging in an Excel spreadsheet and have been supremely annoyed by the formatting and spacing and all manner of other things that make it untidy and tedious?

Well, we did.  So, a couple months ago, we added a new text mangling tool to our simple web tools page, we introduce, The Simplify to a single string – granted, we don’t have the prettiest names for our web tools.

It was originally designed to online transaction details from a bank web page that includes a small table, and turn it into a single string that we save in Excel for logging purposes.  It’s turned out to be useful for mangling all sorts of web snippets to make them Excel, Word, and even email friendly.

We strip all formatting, remove extra spaces, and modify table cells and line breaks by replacing the breaks with dashes (“-“).

It’s useful to us, and hopefully to you!  Enjoy.

Creating a single-quoted comma separated line of text

Friday, March 27th, 2009

Today I had a need to create a single line of text like this:

‘product1.jpg’, ‘product2.jpg’, ‘product3.jpg’

From a text blob that looks like this:

product1.jpg
product2.jpg
product3.jpg

This text chunk, in this case, comes from a copy-and-paste from a “dir *.jpg” in a Windows XP command window.

There were actually only 6 image file names that I wanted to put into an array in PHP, but I had a feeling that I would be doing this type of task again, so I spent the time to build a tool for it.

So if you need to do something similar, please try the latest addition to Perceptus’ Web Tools site, the List to single quoted CSV Text Wizard (admittedly, we don’t save our best names for that site).  All you need to do is paste in a bunch of words, one per line, and you’ll get back the one line CSV.

I think this will be handy for creating source code for arrays in many languages, and also creating the bulk of the syntax for an IN () SQL statement.