Bogiecom.com
  • About
  • Magento
  • Sitecore
  • WordPress

Category Archives: HTML

Powershell String Formatting to Html

Posted on August 22, 2012 by bc-admin

Ever had a bunch of rows in a text file that you would like to format as an html table, but don’t want to take as much time formatting all of the tr and td rows.  You can do something like this:

Say you have a comma-delimited text file with some rows like:

1
foo1,foo2,foo3

And you want to output them as html or something, you can do something like this:

1
2
Get-Content .\thetext.txt | %{ $data = $_.split(","); Write-Output "
$($data[0]) $($data[1]) $($data[2])" } > text-output.html

You should get something like this:

1
foo1 foo2 foo3

It certainly speeds up some tedious formatting of some static or maybe dynamic data.

Posted in Comma-Delimited, Files, HTML, Powershell | Leave a comment |

Pages

  • About
  • Magento
  • Sitecore
  • WordPress

Archives

  • January 2017
  • December 2013
  • November 2013
  • February 2013
  • January 2013
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • November 2011
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • September 2009

Categories

  • .NET
  • Air Force
  • Apache Configuration
  • Bash
  • C#
  • Comma-Delimited
  • Custom Field Validator
  • Date Format
  • Dump Files
  • Files
  • Grep
  • Grooveshark
  • HTML
  • Image Resizing
  • Imagick
  • Integration
  • jQuery
  • Konami Code
  • Linux
  • Magento
  • Magento Third Party CMS Integration
  • Mini Shuttle
  • Miva Merchant 5.5
  • MySQL
  • PHP
  • Powershell
  • Regular Expressions
  • Rename-Item
  • Sed
  • Shell Scripting
  • Sitecore
  • Strings
  • Uncategorized
  • Updating Product Attributes
  • Video Games
  • Wordpress
  • X-37
  • XML
  • YUI Konami Event

CyberChimps WordPress Themes

© 2008 - 2016 Bogiecom.com