in reply to dbf_dump to apply to multiple files in a directory
Howdy solanum, welcome to the Monastery!
You don't actually need Perl for this. The following would also work (if you're using bash or a similar shell; I don't have any experience with C shells):
$ for i in *.dbf; do dbf_dump --fs "," "$i" >"$i.csv"; done
If you want to use Perl, my anonymous brothers have already provided some advice. The main problem with your script is that you're trying to call an external command (dbf_dump) as you would from a shell script. But Perl isn't a shell, it's a programming language, so you have to use a function like system to run external commands.
The error you're getting is related to that: "bareword found where operator expected, near "--fs"" tells you that Perl is trying to parse your dbf_dump invocation as Perl and failing to make sense of it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: dbf_dump to apply to multiple files in a directory
by solanum (Initiate) on Aug 03, 2014 at 19:14 UTC | |
by AppleFritter (Vicar) on Aug 03, 2014 at 20:56 UTC | |
by Anonymous Monk on Aug 03, 2014 at 21:25 UTC |