Computer Learning Zone CLZ Access Excel Word Windows

If it ain't broke, don't fix it.

-280th Rule of Acquisition
 
Home   Courses   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Back to Visitor Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
manipulating table data
Russ Wittig 

2 months ago
I got handed an Access database of library books, with a request to "pretty it up."  All the titles are entered in all upper-case chaacters. I need to convert them all to title case, so the first letter of each word is uper-case, everything else is lower-case.  What is the best way to do this?
Alex Hedley  @Reply  
           
2 months ago
Gary James  @Reply  
      
2 months ago
if you're familiar with PowerShell you could use the following scripts.

---------------------------------------
Details# Get clipboard text
$input = Get-Clipboard
# Convert to title case, preserving symbols and punctuation
$titleCase = ($input -split '(\W+)') | ForEach-Object {
    if ($_ -match '^\w+$') {
        $_.Substring(0,1).ToUpper() + $_.Substring(1).ToLower()
    } else {
        $_  # Preserve symbols/spaces as-is
    }
}
# Join and send to clipboard
Set-Clipboard -Value ($titleCase -join '')


This will change the case of any text string on the clipboard to Title case.
---------------------------------------

========================================
The following will change the clipboard text to UPPER CASE.

$text = Get-Clipboard
$text.ToUpper() | Set-Clipboard

========================================

****************************************************
This will strip out any CRLF text content to put all the text on one line.

DetailsAdd-Type -AssemblyName System.Windows.Forms
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8

function Get-PreferredText {
    $dataObj = [Windows.Forms.Clipboard]::GetDataObject()
    foreach ($format in @("UnicodeText", "Text", "System.String")) {
        if ($dataObj.GetDataPresent($format)) {
            $text = $dataObj.GetData($format)
            if ($text -is [string] -and $text.Trim().Length -gt 0) {
                return $text
            }
        }
    }
    return $null
}

function Get-HTMLFragment {
    $dataObj = [Windows.Forms.Clipboard]::GetDataObject()
    if ($dataObj.GetDataPresent("HTML Format")) {
        $html = $dataObj.GetData("HTML Format")
        if ($html -is [string]) {
            $start = $html.IndexOf("StartFragment:")
            $end = $html.IndexOf("EndFragment:")
            if ($start -ge 0 -and $end -gt $start) {
                $startOffset = [int]($html.Substring($start + 14, 10).Trim())
                $endOffset = [int]($html.Substring($end + 12, 10).Trim())
                return $html.Substring($startOffset, $endOffset - $startOffset)
            }
        }
    }
    return $null
}

function FlattenText($text) {
    $text -replace '<[^>]+>', '' -replace ' ', ' ' '
          -replace "(\r\n|\n|\r)", " " -replace "\s{2,}", " " '
          | ForEach-Object { $_.Trim() }
}

# Main logic
$rawText = Get-PreferredText
if (-not $rawText) {
    $rawText = Get-HTMLFragment
}

if (-not $rawText) {
    Write-Host "'n? No usable clipboard content found."
} else {
    $flattened = FlattenText $rawText
    Write-Host "'n?? Flattened Text:"
    Write-Host $flattened
    Set-Clipboard -Value $flattened
    Write-Host "'n? Clipboard updated."
}

Read-Host "'nPress Enter to exit"

****************************************************
Alex Hedley  @Reply  
           
2 months ago
Gary you could just use

(Get-Culture).TextInfo.ToTitleCase

PS> $words = 'wAr aNd pEaCe'
PS> $TextInfo = (Get-Culture).TextInfo
PS> $TextInfo.ToTitleCase($words)
War And Peace
Gary James  @Reply  
      
2 months ago
Alex Thanks Alex.  I'm still learning PowerShell with tremendous hand holding help from CoPilot.   CoPilot helped convert my old DOS Batch files to PS! scripts along with the code shown above.
Alex Hedley  @Reply  
           
2 months ago
If there's anything you'd like me to cover in the PowerShell TechHelps let me know.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Visitor Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 2/6/2026 8:32:54 PM. PLT: 2s