How to use case statements in BASH?

I have code which extracts the time stamping’s by matching a key word/sentence of a .log file which is existing in several folders of the form log_Job_*. It calculates time duration’s of different processes and write the output to a .CSV file.

What columns I want to have in my .csv:

  1. FileName
  2. ProcessType
    • Import
    • Validate
  3. . .
  4. MainPartionDuration

Now the problem is, I have 2 types of process under 2. Process Type. So, thought of using case statements here. And did as following:

#!/bin/bash  Header="Filename1,ProcessType1,TotalDuration1,Initialization1,MPEProcessDuration1,TotalPartitionDuration1,WaitPartitionDuration1,MainPartionDuration1" echo $  Header >>OutputFile_Validate.csv  cd /path/to/manoj/version_2019_logs/ for file in log_Job_*/manoj.log; do     ProcessType1="$  (grep -F 'Running process mpeXbrlImport.xml' "$  file" | awk '{print $  5}' | cut -c 4-)" #echo "$  ProcessType" ProcessType2="$  (grep -F 'Running process mpeXbrlValidate.xml' "$  file" | awk '{print $  5}' | cut -c 4-)" #echo "$  ProcessType" ProcessType="$  ProcessType1","$  ProcessType2" case $  ProcessType in  $  ProcessType1)  set of commands to get other variaqbles  Var="$  Filename","$  ProcessType","$  TotalDuration","$  Initialization","$  MPEProcessDuration","$  TotalPartitionDuration","$  WaitPartitionDuration","$  MainPartionDuration" echo $  Var >>OutputFile_Import.csv ;; *)  repeat the set of commands and this time save with different variable names Var1="$  Filename1","$  ProcessType1","$  TotalDuration1","$  Initialization1","$  MPEProcessDuration1","$  TotalPartitionDuration1","$  WaitPartitionDuration1","$  MainPartionDuration1" echo $  Var1 >>OutputFile_Validate.csv ;; esac     done 

With this my plan is to create two seperate .CSV files based on the Processtype and then concatenate both the files.

Problem: The script is getting executed successfully, but at the end it is generating only one file i.e. OutputFile_Validate.csv

I have verified the script carefully, am not using any variables repeatedly. Can someone tell me, what could be the reason for this!!