Home » Code Snippets » Import From CSV File

Import From CSV File

Calendar

May 2014
M T W T F S S
« Apr   Jun »
 1234
567891011
12131415161718
19202122232425
262728293031  
Advertisements

static void ImportFromCSVFile(Args _args)
{
#File
CommaTextIo commaTextIo;
FileIOPermission permission;
container containFromRead;
int x;
int cols;
int rowNum;
int row;

permission = new FileIOPermission(@’C:\DMC.csv’,#io_read);
permission.assert();

commaTextIo = new CommaTextIO(@’C:\DMC.csv’,’R’);
rowNum = 0;

containFromRead = commaTextIo.read();
While(containFromRead)
{
if(rowNum>0) //excluding header of file
{

Cloum1=any2str(conpeek(containFromRead,1));
Colum2=any2str(conpeek(containFromRead,2));

}

containFromRead = commaTextIo.read();
rowNum++;
}
commaTextIo = null;
}

 

Advertisements

1 Comment

  1. […] //you can find the link to read the csv file from here […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: