Unix/Linux Go Back    

Remove the leading and trailing date from a CSV file

Shell Programming and Scripting

Kindly Note - This is a Single User Post by Forum Member jgt Regarding:
Remove the leading and trailing date from a CSV file.
Please Follow The Primary Link Above to View the Full Discussion.

Old Unix and Linux 07-12-2017   -   Original Discussion by shivamayam
jgt's Unix or Linux Image
jgt jgt is offline Forum Advisor  
Registered User
Join Date: Apr 2007
Last Activity: 21 March 2018, 9:48 PM EDT
Location: 44.21.48N 80.50.15W
Posts: 2,037
Thanks: 2
Thanked 280 Times in 262 Posts
Try using bash substrings:

#run interactively
 echo $a                                 
#remove the first 11 characters           
echo $b
#set l to the length of string b
echo $l
#set s to the middle length of string b
let s=$l-13                             
echo $s
#set c to the middle part of the string  
echo $c                                 
#concatenate string c and ".csv"         
echo $d