|
If it's a CSV (which is distinct from an 'excel file' which to most of us
means .xls or .xlsx/m/b) then you should just need to adjust the informat
and format length, i'd think. Maybe 200 is not enough? Or, maybe you are
only showing the first so many characters due to the format? You can have
thousands of chars in a field, after all.
Usually the best thing to do is either to infile input without delim, and
just read the whole line into one variable, and see what it comes in as - a
variable with length equal to the maximum line length, so 50000 or whatever
- or, open it in textpad/editplus/etc. and see what it looks like there (a
text editor that has row-column listed somewhere). That will tell you a lot
about it, particularly how long you need to make the variables.
If you need to get rid of the spaces, once you get it in with a large
variable, you should be able to trim it (using compress or compbl, or trim,
or left/right).
If this doesn't help, could you perhaps paste a few lines of this data (or,
something that behaves identically but is not proprietary/hipaa covered)
into a message?
-Joe
On Mon, Jan 5, 2009 at 12:40 PM, Tiffany <tiffany.vidal@gmail.com> wrote:
> On Jan 5, 12:52 pm, ajayo...@yahoo.com (ajay ohri) wrote:
> > copy and paste..use dde if need to automate
> >
> > --- On Mon, 1/5/09, Tiffany <tiffany.vi...@GMAIL.COM> wrote:
> >
> > > From: Tiffany <tiffany.vi...@GMAIL.COM>
> > > Subject: importing lots of text from Excel
> > > To: SA...@LISTSERV.UGA.EDU
> > > Date: Monday, January 5, 2009, 11:09 PM
> > > Hi everyone,
> >
> > > I am trying to import an Excel file with two fields that
> > > have
> > > comments. These can be null up to a paragraph or so. I
> > > have tried a
> > > straight proc import as well as an infile statement
> > > assigning these
> > > fields a format of $200. Neither seems to work. I get
> > > maybe the
> > > first 10 characters in the field. Does anyone have a
> > > suggestion on
> > > how to do this properly?
> >
> > > thank you for your help!!
> >
> > > Tiffany/
>
> ************************************************************************
> Using DDE:
> I tried the following statement. The data were imported, but the
> comment fields were still truncated. The comments are in columns A, B
> and C.
>
> OPTIONS NOXSYNC NOXWAIT;
> X '"C:/interviews/interview_24NOV08.csv"';
> filename goods DDE 'Excel|W:/interviews/[interview_24NOV08.csv]
> interview_24NOV08!R1C1:R28C6';
> data inter;
> INFILE goods NOTAB DLM='09'x DSD MISSOVER lrecl=50000;
> informat FIELD_NAME $20.;
> informat FIELDS $30.;
> informat EXAMPLE $20.;
> informat A $200.;
> informat B $200.;
> informat C $200.;
>
> input FIELD_NAME $ FIELDS $ EXAMPLE $ A $ B $ C $;
> run;
>
|