Advertisement
Guest User

Untitled

a guest
Aug 28th, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.32 KB | None | 0 0
  1. counter=0
  2.  
  3. for EveryLine in `cat input.txt`
  4. do
  5.   let counter=counter+1
  6.   let now=counter%10
  7.   if [ $now -eq 0 ]; then
  8.     count=10
  9.     echo $EveryLine | sed -r "s/^([^,]*),(.*)$/\1,$count,\2/"
  10.   fi
  11.   if [ $now -ne 0 ]; then
  12.     count=$now
  13.     echo $EveryLine | sed -r "s/^([^,]*),(.*)$/\1,$count,\2/"
  14.   fi
  15. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement