Shuffle rows - CSV to Excel - Using datatable


#1

Hello,

When I try to convert a CSV to excel file using datatable approach, is it possible the rows might be shuffled? And even my headers are only appearing at the bottom? Is there any reason to this?

What I did - Steps

  1. Read csv to read the csv file
  2. store the output in datatable dt1
  3. use excel application scope
  4. write range to write the output to a new excel sheet

However when I see the output excel, data is generated but in random order. Is it possible? Moreover my headers are displayed as a last row. Why do you think this is happening?


#2

Hi @Selvasathappan, why not use read excel to read your excel file at the first step?

Cheers.


#4

Sorry, I am using read csv to read csv file in the first step


#5

hi @Selvasathappan, it should be the same sequence as your csv. May I get a screenshot of your csv file?


#6

Hello Quihan,

Thanks for the response. However before I could try the earlier issue, I had to work on other task. Can you please help me with the below task? I am struggling to get this right with limited knowledge in .net


#7

Hi @Selvasathappan, I think there are some suggested solutions at your previous post.
Cheers :slight_smile:


#8

@quihan - Hello quihan, can you help me with this?


#9

@quihan - Can you please help me with this?