0000000 \0 001 \n j k \v \f z { | } ~ 177 \r 016 017 0000020 020 021 022 023 002 024 025 026 027 030 031 032 033 034 035 003 0000040 036 037 ! " # $ % & ' 004 ( ) * + , 0000060 - . / 0 1 005 2 3 4 5 6 7 8 9 : ; 0000100 006 < = > ? @ A B C D E \a F G H I 0000120 J K L M N O \b P Q R S T U V W X 0000140 Y \t Z [ \ ] ^ _ ` a b c 0000154
Scan a file and print out a list of ASCII characters that are not used in the file which can then be safely used to delimit fields. Useful when needing to convert CSV files using "," to a single character delimiter. Piping it into less at the end (which could be redundant) stops the command characters being interpreted by the terminal.
Here's a perl version that only considers printable characters. Change the regex /[[:print:]]/ to look for different sets of delimiter characters.
Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?
You must be signed in to comment.
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: