Xref: utzoo comp.databases:10687 comp.sys.mac.apps:7023 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!olivea!uunet!ahmcs!alan From: alan@ahmcs.uucp (Alan Mintz) Newsgroups: comp.databases,comp.sys.mac.apps Subject: Re: foxbase/dbase Message-ID: <210@ahmcs.uucp> Date: 22 Jun 91 00:48:47 GMT References: <1991Jun19.152025.14890@ncsu.edu> <1991Jun19.184113.2436@agate.berkeley.edu> Followup-To: comp.databases Organization: Micro-Quick Systems, Inc. Lines: 62 In article <1991Jun19.184113.2436@agate.berkeley.edu>, steve@violet.berkeley.edu (Steve Goldfield;232HMB;3-6292;;MF62) writes: > In article <1991Jun19.152025.14890@ncsu.edu> dcc@ccvr1.ncsu.edu (Daniel Carr) writes: > #> > #>in a previous post i said: > #> > #> i'm trying to set up a database so that we don't have to use foxbase > #> mac's report generator. i would like to use MS Word's Print Merge > #> feature, but i can't seem to get output from the database to be in a > #> file that Word expects (i.e. a line with the field names, separated by > #> tabs, and then each line being a record, with each field separated by > #> tabs. i can do one or the other, but not both in the same file. > #> > #> if you know anyone doing this, please ask them to give me pointers. i'm > #> about it give up. > > You might try > > COPY TO FILENAME SDF > > Standard data format (SDF) has text inside double > quote marks, fields separated by commas, and a new line > for each record. Most word processors can read it in. > If you have to use a tab, you should be able to convert, > though you may have commas in your data. You can substitute > "," with "tab" in your word processor. > > I generate data for WriteNow with SDF. Actually, SDF generates non-delimited, fixed-length records, like: . . . COPY TO blah DELIMITED generates the quoted, comma separated records. You can use DELIMITED WITH x, where x is a character to use instead of the ""s. If there are no ~ chars in your data, you could use: . use dbf_name . copy to dbf_name.txt delim with ~ This will generate a file that looks like: ~~,~~,~~ ~~,~~,~~ ~~,~~,~~ . . . Under UNIX, you could then do: cat dbf_name.txt | sed 's/~,~/ /g' | tr -d '~' > final.txt ^^ - That's a tab to turn the ~s into tabs. I presume there are tools on the Mac to accomplish the same thing ? -- < Alan H. Mintz | alan@ahmcs.mq.com | ...!uunet!ahmcs!alan >