Posts Tagged With: lines

Find number of lines in a file

Tagged with: , , , , ,

Find the number of lines in a file using this command…


cat -n file
OR
wc -l file
No Comments »

Changing separator with Perl

Tagged with: , , , , ,

This will join all lines of a file together. Sometimes I have a list of something in a file, one line per item and want to convert it to a comma(colon,tab)-separated line (with no trailing separator of course) that can be used as a command-line parameter to some other tool.


perl -e '@_=; chomp(@_); print join(";",@_);' < data_file
No Comments »