I am writing output of 6 UNIX variables into a CSV file. Yes,now I have a CSV file with all the columns that I want.But, I want to use those variable names as column Name/ column Header.
How can we do this in bash ??
THis is what I have:
#!/bin/bash
cd /path/to/manoj/version_2019_logs/
for file in log_Job_*/manoj.log; do
set of commands
Var1="$Filename1","$ProcessType1","$TotalDuration1","$Initialization1","$MPEProcessDuration1","$TotalPartitionDuration1","$WaitPartitionDuration1","$MainPartionDuration1"
echo $Var1 >>OutputFile_Validate.csv
done
Can somebody help me!!
Just add the header line before printing the data to the file:
For the sake of completion,
bash
also has a variable name expansion feature, thusexpands to the variable name
and if
$Filename1
and$Filename2
are setexpands to this space-separated variable name list:
Unfortunately that’s not really helpful here.