CSV file to Tab Delimited for use in spreasheet
CSV file to Tab Delimited for use in spreasheet
- Subject: CSV file to Tab Delimited for use in spreasheet
- From: Al Desrosiers <email@hidden>
- Date: Fri, 24 May 2002 20:44:34 -0500
CSV file to Tab Delimited for use in spreasheet
I download CSV formated stock quotes from yahoo and have been using the
enclosed script to convert to Tab Delimited for transfer to an
Appleworks
Spreedsheet.This has been working fine in system 9x. I did a copy and
paste
to system 10x Script Editor. When I "Check Syntax" I get the following
error message
Expected "into" variable name, class name, other
parameter name or
property but found end of line. (The problem is
where I inserted ?????)
I have a 700mhz iMac with system 10.2.4. I'm looking for
help to modify script for use in system 10
Thank You, Al
-- begin script
on open (these_files)
set oldtids to AppleScript's text item delimiters
repeat with each_file in these_files
if last character of (each_file as text) is ":" then
-- it's a folder, do nothing
else
--it's a file
set this_file to open for access each_file with (?????)
write permission
try
set comma_text to read this_file
set tab_text to textReplace(comma_text,
",", tab)
set eof this_file to 0
write tab_text to this_file
on error
close access this_file
end try
close access this_file
end if
tell application "AppleWorks 6" to open each_file
end repeat
set AppleScript's text item delimiters to oldtids
end open
on textReplace(theText, srchStrng, replStrng)
tell (a reference to AppleScript's text item delimiters)
set {od, contents} to {contents, {srchStrng}}
try
set {textList, contents} to {(text items of
theText), {replStrng}}
set {newText, contents} to {(textList as text), od}
return item 1 of result
on error errMsg number errNbr
set contents to od
error errMsg number errNbr
end try
end tell
end textReplace
-- end script
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.