[muglo] Re: CSV File

  • From: Dave Knight <dave@xxxxxxx>
  • To: muglo@xxxxxxxxxxxxx
  • Date: Mon, 24 Jan 2011 23:36:51 -0500

I had never played with Automator until just now. It's really quite cool, and 
the answer is yes.

Here's what I did... 

1. Started up Automator and chose the "Folder Action" template for my new 
workflow

2. Folder action receives files and folders added to: created a new folder on 
the Desktop called semi2comma

3. Dragged in a Library / Utilities / Run Shell Script workflow and configured 
that as follows

        Shell: /bin/sh  Pass input: as arguments

and filled in the script part like so

        sed -i '' 's/;/,/g' "$@"

4. Save As "convertsemi2comma"

5. Quit Automator

Now when I drag your test file into that folder it is automagically converted 
on the way.

dave


On 2011-01-24, at 9:16 PM, Terry Genereaux wrote:

> Works great is there a way to make that a command into a automator script..


> Dave wrote:

>> There are many ways to replace the ; with , in your file, here's one using 
>> one of the UNIX tools on your Mac
>> 
>> Save your CSV file on your Desktop
>> 
>> Start a terminal
>> 
>>      /Applications/Utilities/Terminal.app
>> 
>> Run these commands in the terminal 
>> 
>>      cd Desktop
>>      sed 's/;/,/g' SYNAVE.CSV > SYNAVE-2.CSV
>> 
>> That changes into the Desktop folder, then has the sed utility switch (s///) 
>> all (/g) ';' to ',' in the file SYNAVE.CSV and save the result in 
>> SYNAVE-2.CSV

---
Manage your account options at //www.freelists.org/list/muglo

Other related posts: