1
vote
0answers
33 views

Reordering file lines like other file (Unix)

Is there a tool (or option for sort) which will re-order lines of a file so that they are ordered like a key in another file? For example, I have a data file: T01F01475558 30 T01F022B3A17 31 ...
0
votes
1answer
54 views

Unix text streams to serve as message queues

The UNIX philosophy suggests we built a lot of simple programs that do one thing well and that we do them with text streams. That is, the standard input/output channels are sufficient means of ...
0
votes
0answers
277 views

How to unwrap 80 character text

Many text filess around Internet are word split before line reaches 80th character. I understand it is desirable by those using 80 character terminals. However I like sending longer articles to my ...
0
votes
4answers
189 views

Split text stream by hash value of first field in line

I am looking for a fast filter that will take a text file on standard input, hash each line up to the first tab character, and put the line into a different file depending on the hash value (modulo ...
0
votes
2answers
120 views

What does shiftwidth do in VIM editor

I read this about shiftwidth option on Google: To change the number of space characters inserted for indentation, use the 'shiftwidth' option. Ok Ok, but what's that more exactly? How can I try this ...
2
votes
3answers
300 views

How to extract bytes from the middle of a file?

We are parsing some large EDI files that do not contain CR/LF. However, they do have ~ (tilde) as a segment delimiter. I am trying to extract the control record for the file and the last bytes of my ...
0
votes
2answers
66 views

How to calculate a column of sums or test inequalities?

Given 34-2 34-5 34-3 I'm looking to obtain 34-2=28 34-5=29 34-3=31 Or, this would also be helpful: given: 34-2=5 34-5<=34 34-3=31 I'm looking to obtain ! 34-2=5 34-5<=34 ...
0
votes
1answer
449 views

Append line length at end of each line

Given input: tree branch the desired output is tree 4 branch 6 What is a *nix available command that does this?
1
vote
0answers
269 views

Getting complement of two text files on the Unix command line

Is there a fast Unix-based utility (ideally written in C) for getting efficient, streaming intersection/union of tab-delimited text files? For example, allow queries such as "give me the all the ...
0
votes
1answer
9k views

UNIX: how to merge 2 text files?

Is there a way to merge 2 text files into one (by appending the content of the second right after the first one) in Unix ?
4
votes
5answers
1k views

Open source command line tools for indexing a large number of text files

I'm looking for any open source command line tool or tools which will allow me to index and search a large number of plain text files. Approximate search would be a plus. The tool only needs to print ...
2
votes
5answers
354 views

How do I reverse the lines of a file in UNIX

How can i reverse a line in a file in Order Example : Input file : 123 500 1000 LOAN GOD 10000 01000 Output Format: 321 005 0001 NAOL DOG 00001 00010
2
votes
3answers
1k views

Recovering text files in terminal using grep on Mac OS X Snow Leopard

I foolishly removed some source code from my Mac OS X Snow Leopard machine with rm -rf when doing something with buildout. I want to try and recover these files again. I haven't touched the system ...