Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Merge all names into 1 file



On 11/6/06, Jan Bultereys <email@hidden> wrote:
 I have 7 text files
 ....

 Is it possible to merge the 7 files into ONE where all the "duplicated"
names are merged into one.

Sure.

do shell script "sort -u " & (quoted form of POSIX path of file1) & "
" & (quoted form of POSIX path of file2) & " "  & ... & " " & (quoted
form of POSIX path of file7) & ">" & (quoted form of POSIX path of
resultFile)

if you have the filenames in a list you can of course build the
command string up with a loop, which would be less unwieldy (more
wieldy?). If you really want 'all the files in this folder' then that
would be a better way to approach it, too.  The important thing is
that you wind up with a shell command that consists of "sort -u "
followed by the quoted POSIX paths of all the files, separated by
spaces, followed by ">" and the quoted POSIX path of the file you want
the sorted uniquified results to go into.



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

This email sent to email@hidden
References: 
 >Merge all names into 1 file (From: Jan Bultereys <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.