Hot answers tagged

5

Right idea - wrong implementation you need to store the field values in an array indexed by the field position. So instead of a[$i], make that a[i]=$i then you need to look up the values by index in the array. So not $i="a" but $i=a[i] As an aside, $i == "\." isn't a regular expression test, so you don't need to escape . $ awk -F'|' 'BEGIN{OFS=FS} NR==1 {...


1

With awk awk -F '[ \t]+$' 'NF>1{t=substr($0,length($1)+1);gsub(/./,"_",t); $0=$1 t} 1' This also handles a mixture of trailing tabs and spaces. The field separator (-F, FS) can be easily adjusted to only match spaces or also match other kind of invisible characters, provided that it's kept anchored at the end with $. To make that work for leading ...


1

IIUC, you could use Perl implementation of rename program (there is another program called rename which is a part of util-linux package). Example - first let's re-create a list of files you presented in your question: $ touch 0{1..9}\ Disc\ 01\ My\ Song.mp3 $ ls -l total 0 -rw-r--r-- 1 ja users 0 Mar 30 01:41 01 Disc 01 My Song.mp3 -rw-r--r-- 1 ja users 0 ...


1

Using google translate, I found that the chinese text at the bottom is just declarations that it complys with chapter 15 of the us federal radio rules, or at least something along those lines. With a bit of quick googling, I also found that I believe you have a Super Pen PP3333 Uc-Logic graphics tablet. I didn't have enough time to see if I could find ...


1

Whip up a tiny C (or Perl, Python, whatever) program that reads one byte at a time and keeps totals. Any language that isn't totally braindead on a reasonable operating system will handle buffering and other chores transparently in reasonably efficient way.


Only top voted, non community-wiki answers of a minimum length are eligible