Skip to content
Prev 294866 / 398503 Next

Importing ASCII flat

On May 17, 2012, at 8:17 AM, Richard Iles wrote:

            
Your data layout was mangled by passage of html formating through  
various mailers. Looking at:

http://mospi.nic.in/Mospi_New/site/inner.aspx?status=4&menu_id=67

... I'm guessing you are showing only a tiny slice of the data  
specification.
That was my best guess at what might have originally been the fixed  
format layout. You should look at:

?utils::read.fwf

If you can create a data.frame, dfrm,  from that data layout, then the  
most useful fields would be the names and the lengths. Perhaps this  
could work

read.fwf(file, widths=dfrm$Len, col.names= dfrm$Item)
PLEASE, please, please : Learn to post in plain text.
David Winsemius, MD
West Hartford, CT