Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Adding header to csv file with Applescript overwrites beginning of file. Why?

Featured Replies

I'm trying to add a header to my bank statement to import it into Filemaker properly, but my script overwrites the first four characters before adding the desired text. I'm quite green with Applescript, and I can't see my mistake. Any help would be appreciated.

Here's the beginning of the file before the script (date, amount, transaction type, transaction detail) is run

4/30/12,-63.00,000000399,"Cheque",""

and after:

,,,

/12,-63.00,000000399,"Cheque",""

I wanted to add the ",,,

"

What's happened to "4/30" ?

Here's my script:

tell application "Finder"

open for access "Macintosh HD:Users:johnnolan:Documents:RandB database FM12:Statements:Exported from containers:temp_statement.csv" with write permission

write ",,," & return to file "Macintosh HD:Users:johnnolan:Documents:RandB database FM12:Statements:Exported from containers:temp_statement.csv"

close access file "Macintosh HD:Users:johnnolan:Documents:RandB database FM12:Statements:Exported from containers:temp_statement.csv"

end tell

Not directly related to your question, but why is it necessary "to add a header to my bank statement to import it into Filemaker properly"? If you know in advance the order of the columns, why not simply import the file using a script?

  • Author

I am importing with a script, but I can't get the first record in; the file just starts with data on the first line; I get the second and subsequent records imported, but not the first. Is there some other way around this?

You don't need to use Applescript at all in filemaker you create a youur script step there is a dialog or checkbox on the import script step that asks if you wish to import the first row as column headers or treat it as DATA you will wish to select the second option and you will result in importing all your data.

  • Author

Duh! I had inadvertently set the file type to merge in my first attempt with the script, and after that missed the option... there's a few hours I'll never get back.

Thanks!

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.