04-20-2011
Many files have text internally, and I am not sure there is a magic for plain text, so file might not be that useful. I actually wrote a pctbin C command to find out what percentage of characters were not in the common ASCII text file set: ' ' through '~', line feed, carriage return, form feed. The trick is figuring out what your professor defines as text!
You can find * -type f | xargs -n999 file and see all the types you have, and write a grep -E pattern that will select or deselect so only text types survive. You can use sed to remove the suffix of ": file type".
The permission are visible in find -ls or ls -l, and you can grep for them, too. Sorting by date is easy with ls -t, but ls has a file count limit. If you use the date, watch out for ls -l having a date-time form for one year and then a date-year form. I wrote a trivial C to take a stream of file name lines and spit them back out prefixed with the mtime.
Hope this helps!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
Iam trying to sort the contents of the file based on the position of the file.
Example:
$cat sample.txt
0101020060731 ## Header record
1c1 Berger Awc ANP20070201301 4000.50
1c2 Bose W G ANP20070201609 6000.70
1c2 Andy CK ANP20070201230 28000.00... (3 Replies)
Discussion started by: ganapati
3 Replies
2. UNIX for Dummies Questions & Answers
Hi Guru's,
I need to create 3 files with the contents "ABC" using single command.
Iam using:
echo "ABC" > file1.txt file2.txt file3.txt
the above command is not working. pls help me...
With Regards / Ganapati (4 Replies)
Discussion started by: ganapati
4 Replies
3. UNIX for Dummies Questions & Answers
Dear all,
It's not entirely clear to me from manpage the difference between them.
Why we still need "-u" flag?
- monkfan (3 Replies)
Discussion started by: monkfan
3 Replies
4. Shell Programming and Scripting
Hi,
sorry for bothering with this easy problem but I can't understand...
I've a file like this:
"4","0x23a3"
"5","0x4234"
"11",""
"20",""
"11132","0x6456"
I would like to create a file like this:
4,23a3
5,4234
11,999999
20,999999
11132,6456
I've tried:
cat INPUT.txt | sed -e... (7 Replies)
Discussion started by: TheMrOrange
7 Replies
5. Shell Programming and Scripting
Hi experts
I want your help to change the file format to my wanted version, please give me a hand thanks
$cat file
install pass
make os pass
make build kernel failed
usb storage pass
chane to
| *install* | *make os* | *make build kernel* | *usb storage* |
| pass | pass... (7 Replies)
Discussion started by: yanglei_fage
7 Replies
6. Shell Programming and Scripting
Hello everyone
Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried
sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
Discussion started by: haggismn
10 Replies
7. Shell Programming and Scripting
Hi all.
I have a .txt file that I need to sort it
My file is like:
1- 88 chain0 MASTER (FF-TE) FFFF 1962510 /TCK T FD2TQHVTT1 /jtagc/jtag_instreg/updateinstr_reg_1 dff1 (TI,SO)
2- ... (10 Replies)
Discussion started by: Behrouzx77
10 Replies
8. Shell Programming and Scripting
Hi Experts,
I have a string with colon delimited, want 2nd colon to be changed to a pipe.
data:
101:8:43:4:72:14:41:69:85:3:137:4:3:0:4:0:9:3:0:3:12:3:
I am trying with sed, but can change only 1 occurance:
echo "101:8:43:4:72:14:41:69:85:3:137:4:3:0:4:0:9:3:0:3:12:3:" | sed 's/:/|/2'... (5 Replies)
Discussion started by: rveri
5 Replies
9. Shell Programming and Scripting
I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Discussion started by: nightwatchrenba
10 Replies
10. Programming
Hello everyone,
Since my python knowledge is limimted, I've challenged myself to learn as much as possible to help me with my carrere. I'm currently trying to convert a shell script to python, just to give myself a task. There is one section of the script that I'm having issues converting and... (2 Replies)
Discussion started by: da1
2 Replies
LEARN ABOUT DEBIAN
shevek_rostring
shevek::rostring(3) Library Functions Manual shevek::rostring(3)
NAME
shevek::rostring -
shevek::rostring is identical to shevek::ostring, but it uses std::string instead of Glib::ustring.
SYNOPSIS
#include <iostring.hh>
Public Member Functions
operator std::string () const
Use the result as a string.
std::string operator+ (std::string const &that) const
Use the result as a string.
rostring (std::string const &fmt)
Create a string with a constant format.
template<typename T1 > rostring (std::string const &fmt, T1 const &a1)
Create a string with one argument.
template<typename T1 , typename T2 > rostring (std::string const &fmt, T1 const &a1, T2 const &a2)
Create a string with two arguments.
template<typename T1 , typename T2 , typename T3 > rostring (std::string const &fmt, T1 const &a1, T2 const &a2, T3 const &a3)
Create a string with three arguments.
template<typename T1 , typename T2 , typename T3 , typename T4 > rostring (std::string const &fmt, T1 const &a1, T2 const &a2, T3 const
&a3, T4 const &a4)
Create a string with four arguments.
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 > rostring (std::string const &fmt, T1 const &a1, T2 const
&a2, T3 const &a3, T4 const &a4, T5 const &a5)
Create a string with five arguments.
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 > rostring (std::string const &fmt, T1 const
&a1, T2 const &a2, T3 const &a3, T4 const &a4, T5 const &a5, T6 const &a6)
Create a string with six arguments.
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 > rostring (std::string const
&fmt, T1 const &a1, T2 const &a2, T3 const &a3, T4 const &a4, T5 const &a5, T6 const &a6, T7 const &a7)
Create a string with seven arguments.
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 > rostring
(std::string const &fmt, T1 const &a1, T2 const &a2, T3 const &a3, T4 const &a4, T5 const &a5, T6 const &a6, T7 const &a7, T8 const
&a8)
Create a string with eight arguments.
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 >
rostring (std::string const &fmt, T1 const &a1, T2 const &a2, T3 const &a3, T4 const &a4, T5 const &a5, T6 const &a6, T7 const &a7, T8
const &a8, T9 const &a9)
Create a string with nine arguments.
Friends
std::ostream & operator<< (std::ostream &s, rostring const &o)
Send the result to an ostream.
Detailed Description
shevek::rostring is identical to shevek::ostring, but it uses std::string instead of Glib::ustring.
Author
Generated automatically by Doxygen for libshevek from the source code.
libshevek Fri May 11 2012 shevek::rostring(3)