• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Removing spaces from a list in a Text file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Removing spaces from a list in a Text file


  • Subject: Re: Removing spaces from a list in a Text file
  • From: Michelle Steiner <email@hidden>
  • Date: Sun, 4 Nov 2007 07:26:29 -0700

On Nov 4, 2007, at 1:22 AM, Peter Baxter wrote:

I am looking for a script step that would remove all spaces from a list in a .TXT file that contains a list like the one below. Everything I tried removes the returns as well

AND ,Julie Anderson,VC7B      ,7,7B,13,9,22,2,  2.00,
,,ART7G     ,7,7G,13,8,21,2,  2.00,
,,VC7O      ,7,7O,16,,16,2,  2.00,
,,ART8B     ,8,8B,12,12,24,2,  2.00,
,,IP8R      ,8,8R,12,13,25,2,  2.00,
,,ART8R     ,8,8R,12,13,25,2,  2.00,
,,ART9O     ,9,9O,11,10,21,2,  2.00,
,,AST10     ,10,,5,20,25,4,  4.00,
,,2ND       ,Yard Duty,,,,0,1,  0.00,
,,,,,,Totals ,,22, 20.00,/23

set foo to "AND ,Julie Anderson,VC7B ,7,7B,13,9,22,2, 2.00, ,,ART7G ,7,7G,13,8,21,2, 2.00, ,,VC7O ,7,7O,16,,16,2, 2.00, ,,ART8B ,8,8B,12,12,24,2, 2.00, ,,IP8R ,8,8R,12,13,25,2, 2.00, ,,ART8R ,8,8R,12,13,25,2, 2.00, ,,ART9O ,9,9O,11,10,21,2, 2.00, ,,AST10 ,10,,5,20,25,4, 4.00, ,,2ND ,Yard Duty,,,,0,1, 0.00, ,,,,,,Totals ,,22, 20.00,/23"

set text item delimiters to space
set foo to text items of foo
set text item delimiters to ""
set foo to foo as text

--> "AND,JulieAnderson,VC7B,7,7B,13,9,22,2,2.00,
,,ART7G,7,7G,13,8,21,2,2.00,
,,VC7O,7,7O,16,,16,2,2.00,
,,ART8B,8,8B,12,12,24,2,2.00,
,,IP8R,8,8R,12,13,25,2,2.00,
,,ART8R,8,8R,12,13,25,2,2.00,
,,ART9O,9,9O,11,10,21,2,2.00,
,,AST10,10,,5,20,25,4,4.00,
,,2ND,YardDuty,,,,0,1,0.00,
,,,,,,Totals,,22,20.00,/23"

--
Prius:  Kicks Gas

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >Removing spaces from a list in a Text file (From: Peter Baxter <email@hidden>)

  • Prev by Date: Re: Creating a new folder in the Finder
  • Next by Date: Re: Creating a new folder in the Finder
  • Previous by thread: Re: Removing spaces from a list in a Text file
  • Next by thread: Re: Removing spaces from a list in a Text file
  • Index(es):
    • Date
    • Thread