Manipulation of text by programs, scripts, etc.
4
votes
2answers
27 views
shell script/utility replace 2 byte unicode in binary file
I have many large Unicode files. I would like to replace each Unicode byte pair with a new Unicode byte pair. For example, the original file contains
"C3 B9 C3 AB C3 B8 C3 B0"
and I would like to ...
2
votes
3answers
43 views
Print only lines that are completely numeric
I'd like to filter through a text file and only print the lines where each column is a valid floating point number. For example:
3 6 2 -4.2 21.2
3 x 4.2 21.2
3 2 2.2.2
Only the first line would ...
2
votes
3answers
36 views
Extract integers enclosed in round brackets
I'm new to Linux. I've a file which contains list of movie names and their release year. I want to list out all release years. Specifically my file looks like below
TDKR(2012)
Vicky Cristina ...
7
votes
2answers
215 views
How to print only the duplicate values from a text file?
Suppose there is a column of numeric values like following:
File1:
1
2
3
3
3
4
4
4
5
6
I want the output:
3
4
That is, only the repeated lines. Is there any command line tools to find this ...
1
vote
1answer
22 views
Join problem: throwing error, join extra operand
I want to join 3 files on a column which has sorted unique numeric values (those files have only one column of values though) and starts with same prefix for an example "usi".
Now, while I am doing ...
1
vote
1answer
68 views
Text processing - Find text before/after given word
I would like to extract contents between Station Name and Data End of the file:
Structure of text file for clarification:
---- Huge text -- not interested
Station Name
100 - 200 lines
Data End
---- ...
6
votes
6answers
195 views
Text processing - join lines with commas
I have more than 1000 lines in a file. The file starts as follows (line numbers added):
1. Station Name
2. Station Code
3. A N DEV NAGAR
4. ACND
5. ABHAIPUR
6. AHA
7. ABOHAR
8. ABS
9. ABU ROAD
10. ...
3
votes
1answer
57 views
Identify the number of unique values and then the number of occurrences of those values in the file
I have a data file which contains 15000 lines, but only 400 unique values. I am looking for a way to identify the number of unique values and then the number of occurrences of those values in the ...
4
votes
3answers
109 views
Delete the matching line and several more from a file
I have a text file called file_a.txt.
My first command is
grep -A 12 ".production =" file_a.txt
The output is a few block.
Each block of string contains 13 rows
I specifically want to delete all ...
2
votes
2answers
69 views
How can I enhance the output of find and grep?
I really don't look forward to having to do find/grep because the output, as returned by
find . -exec grep sometext {} \; -print
is just not very easy to read even when you dump it in a file. What ...
0
votes
2answers
57 views
Is it against linux ethos to provide a progress indicator for running commands? [closed]
Possible Duplicate:
Why doesn't cp have a progress bar like wget?
Lately I have been dealing with rather large files in Linux. I often use commands like sed, cut, sort, uniq, awk, and ...
4
votes
1answer
52 views
Is there a command like head but for line truncation?
Linux's head selects a number of lines from the top of a file. Is there a command that selects a number of characters from the front of a line?
The use case behind the question is this: I want to ...
2
votes
3answers
67 views
Convert a tab-delimited file to use newlines
input.txt (around 30K lines)
RT|367079254|bn|ERTS01065811.1| 38 1 503
RT|367079251|bn|ERTS01065814.1| 56 3 502
RT|367079248|bn|ERTS01065817.1| 52 2 502
output.txt
RT|367079254|bn|ERTS01065811.1|
...
4
votes
4answers
124 views
Look for English word in a file via terminal
How to find and print out English words contained in a file via linux command line?
Thanks
1
vote
2answers
68 views
Substitute pattern within a file with the content of other file
I have a text file (devel.xml).
I added the word REPLACETHIS to it in order to replace this string with the content within a different file (temp.txt).
The closest thing I have is this:
sed -i -e ...