Frinton Fogey

Q: use sed to delete a record in applescript

I'm trying to use sed in an Applescript shell script to delete a specific record number. When I enter a number for the record number it works perfectly but I would like to use a calculated variable. I have tried all sorts of escape characters and quoted forms but cannot get it to work, any guidance would be gratefully received.

 

set filePath to quoted form of "/Users/Ours/Documents/Cats Protection/Cats/CP Cats copy.csv"

set recNo to  3

do shell script "sed  -i \"\" 'recNo d' " & filePath -- delete line number

iMac, OS X El Capitan (10.11.2)

Posted on Aug 12, 2016 3:40 AM

Close

Q: use sed to delete a record in applescript

  • All replies
  • Helpful answers