Search Results

Search: Posts Made By: shivamayam
3,228
Posted By jgt
#!/bin/bash for file in *.csv do ...
#!/bin/bash
for file in *.csv
do
len=${#file}
let len=$len-11-13
outfile=${file:11:$len}
cp $file outdir/$outfile.csv
done
Change cp to mv when you have tested.
3,228
Posted By rdrtx1
sed 's/[^_]*_//; s/_[^._]*[.]\(.*\)$/.\1/' infile
sed 's/[^_]*_//; s/_[^._]*[.]\(.*\)$/.\1/' infile
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 11:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy