MACSCRPT Archives

May 2010

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Stockly, Ed" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Mon, 10 May 2010 12:31:30 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (47 lines)
Something like this?:

------
set myFile to choose file with prompt "Select an XML file"
set myText to "one:two:three:four:five:"

set newText to myText & (read myFile)

---------

HTH,

ES


On 5/10/10 6:38 AM, "jeff donovan" <[log in to unmask]> wrote:

> Greetings
> 
> i need to add the contents of a file to the end of each line of a string. It
> would be easy to do a simple sed 's/mytext/newtext/g'
> 
> newtext in this case is an xml file. which needs to stay intact.
> 
> my text looks like this
> 
> one:two:three:four:five:
> 
> 
> output needs to look like this
> 
> 
> one:two:three:four: <?xml version="1.0" encoding="UTF-8"?>\
> <dict>\
> <key>AccountState</key>\
> <string>Enabled</string>\
> </dict>\
> 
> 
> So I thought i could ;
> REPLACE=/path/to/myfile
> cat mytext | sed 's/five/$REPLACE/g'
> 
> 
> im getting stuck any assistance would be helpful.
> -j

ATOM RSS1 RSS2