Insert blank row in excel after every row which contains specific word

Hi

In a excel file i am trying to insert Multiple blank row using Studio X after every row which contains “Meeting”.

and in that blank row i want to write “Learnings”

could you please suggest me steps for this, as i am a beginner please explain complex expression if there is any in that…

Thank You.

Hi @Dhanad_Prathamesh

yourDataTableVariable = (From row In yourDataTableVariable.AsEnumerable()
                        Let containsMeeting = row.Field(Of String)("YourColumnName").Contains("Meeting")
                        Select {row}.Concat(If(containsMeeting, {yourDataTableVariable.NewRow(), yourDataTableVariable.NewRow().SetField("YourColumnName", "Learnings")}, Enumerable.Empty(Of DataRow)()))
                        ).SelectMany(Function(x) x).CopyToDataTable()

Regards

Hi @Dhanad_Prathamesh,

You can try the following steps:

  1. Add an “Excel For Each Row” action and specify the Excel file path and range.
  2. Within the loop, add an “If” action with the condition “Text Exists” to check for the word “Meeting”.
  3. Inside the “If” branch, add an “Insert Rows” action to insert multiple blank rows after the current row.
  4. After inserting the blank rows, add a “Type Into” action to type “Learnings” into the blank rows.

I hope this helps!

Hi @Dhanad_Prathamesh

please check the below attached file:
Insert Blank Rows.zip (152.7 KB)

Regards

Hi @Sridhar_Aswin

Thanks for the response.

I can see in excel file it has inserted blank row only after first “meeting” row.

could you please assist on this.


Main.xaml (12.1 KB)