3
votes
2answers
167 views

How to know if a text file is a subset of another

I am trying to find a way to predict if a text file is a subset of another.. For example: foo bar is a subset of foo bar pluto While: foo pluto and foo bar are not one a subset of each ...
3
votes
3answers
138 views

Transforming text to tabular form

I have a text file with the following structure: aaa bbb ccc ddd eee fff 1 2 3 4 5 6 1.1 1.2 1.3 1.4 1.5 1.6 ggg hhh iii jjj kkk lll 7 8 9 10 11 12 2.1 2.2 2.3 2.4 2.5 2.6 and I want the ...
2
votes
1answer
227 views

Compare all text files in a directory, and sort by similarity

In Unix, is there any way to compare every text file in a directory to every other text file in the directory, and then sort each pair of files by similarity (using the diff utility)? There are ...
7
votes
2answers
2k views

Finding all “Non-Binary” files

Is it possible to use the find command to find all the "non-binary" files in a directory? Here's the problem I'm trying to solve. I've getting an archive of files from a windows user. This archive ...
12
votes
6answers
3k views

Which extension to use for text files? (Unix/Linux)

I noticed that I can read text files without an extension .txt just fine. How come? Should I save these files with or without the .txt extension? Also, what about .ini files? I usually use them like ...
1
vote
1answer
883 views

Get list of Linux files recursively and direct output to file

I'm configuring software on Ubuntu for i2b2, and trying to find all of the relevant files on a CentOS image that I downloaded (path below) and am now running on Windows VMWare Player (free for ...
2
votes
2answers
538 views

How can I get entries for a given time period from a 400MB+ log file?

I have a 400MB+ Tomcat log file (catalina.out). How can I pull out entries for a given time period?
4
votes
1answer
874 views

Replace variable read from a text file (so they can be interpreted)

I tried several stuff with not luck so maybe one of you experts can help me (I hope!). I want to store in a text file some select statement that contain variables like a date: $ cat res.txt select ...
34
votes
5answers
14k views

How to remove duplicate lines inside a text file?

A huge (up to 2 GiB) text file of mine contains about 100 exact duplicates of every line in it (useless in my case, as the file is a CSV-like data table). What I need is to remove all the repetitions ...
11
votes
2answers
5k views

How can I find out how many lines a text file contains without viewing it?

How can I find how many lines a text file contains without opening the file in an editor or a viewer application? Is there a handy Unix console command to see the number?
7
votes
4answers
2k views

creating a sequence of numbers, one per line in a file

Is there a way to create out of thin air, a file that is a sequence of numbers, starting at a given number, one per line? something like magic_command start 100 lines 5 > b.txt and then, b.txt ...
1
vote
2answers
710 views

Should I end my text/script files with a newline? [duplicate]

Possible Duplicate: What's the point in adding a new line to the end of a file? What is considered better behaviour: to leave the last letter of the last line to be the last byte of a ...