NONMEM Users Network Archive

Hosted by Cognigen

RE: FDATA

From: Bachman, William <William.Bachman>
Date: Tue, 24 Apr 2012 13:07:50 +0000

Alternatively, import the file into Excel (or the spreadsheet clone of your=
 choice). Then "save as" a .csv file.



-----Original Message-----
From: owner-nmusers
 Behalf Of Nick Holford
Sent: Thursday, April 19, 2012 4:39 AM
To: nmusers
Subject: Re: [NMusers] FDATA

Justus,

You could try this. Change NMAX to the number of records that FDATA uses
for each individual. The example below shows 2 records in FDATA for each
individual.

gawk can be downloaded here http://www.klabaster.com/freeware.htm#mawk

Nick

======= FDATA ======

1 1 1 1 1
1 1 1 1 1
2 2 2 2 2
2 2 2 2 2
3 3 3 3 3
3 3 3 3 3

======= Command line (any OS that supports gawk) =====
=
gawk -f fdata2csv.awk -v NMAX=3 FDATA>fdata.csv

====== fdata2csv.awk =======

BEGIN {
nrec=0
rec=""
}
{
if (nrec==NMAX) { printrec(); nrec=0; rec="" }
nrec++
rec=rec " " $0
}
END {
printrec()
}
function printrec() {
nitem=split(rec,ITEMS)
outrec=""
for (i=1; i<nitem; i++) {
    outrec=outrec sprintf("%s,",ITEMS[i])
}
print outrec sprintf("%s",ITEMS[nitem])
}



On 18/04/2012 11:43 p.m., Justus Bingham wrote:
> Hello Everyone,
>
> Is there any way to take a NONMEM FDATA file and convert it into a typica=
l .csv file?
>
> Thanks,
>
> Justus

--
Nick Holford, Professor Clinical Pharmacology

First World Conference on Pharmacometrics, 5-7 September 2012
Seoul, Korea http://www.go-wcop.org

Dept Pharmacology& Clinical Pharmacology, Bldg 505 Room 202D
University of Auckland,85 Park Rd,Private Bag 92019,Auckland,New Zealand
tel:+64(9)923-6730 fax:+64(9)373-7090 mobile:+64(21)46 23 53
email: n.holford
http://www.fmhs.auckland.ac.nz/sms/pharmacology/holford



ICON plc made the following annotations.
-------------------------------------------------------------------------=
-----
This e-mail transmission may contain confidential or legally privileged i=
nformation
that is intended only for the individual or entity named in the e-mail ad=
dress. If you
are not the intended recipient, you are hereby notified that any disclosu=
re, copying,
distribution, or reliance upon the contents of this e-mail is strictly pr=
ohibited. If
you have received this e-mail transmission in error, please reply to the =
sender, so that
ICON plc can arrange for proper delivery, and then please delete the mess=
age.
Thank You,
ICON plc
South County Business Park
Leopardstown
Dublin 18
Ireland
Registered number: 145835

Received on Tue Apr 24 2012 - 09:07:50 EDT

The NONMEM Users Network is maintained by ICON plc. Requests to subscribe to the network should be sent to: nmusers-request@iconplc.com.

Once subscribed, you may contribute to the discussion by emailing: nmusers@globomaxnm.com.