Tagged Questions
3
votes
3answers
110 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 ...
5
votes
5answers
136 views
Split the content of a file in linux
I have a text file which has content like this:
abc.tar^@xxx.tar^@yyy.tar^@
Say for example I have this content in a file named abc.txt and I want to split the content and write the first two ...
2
votes
2answers
84 views
Diverting a file write to process
I have an OSX GUI application which I can't change - it writes new CVS lines to a log file when it completes a job. I'd like to work with these new lines, but they are constantly being added.
Is ...
4
votes
3answers
67 views
Replace all the occurences of a term in the files contained in a folder
In a folder on my system, I have a C++ project that I'm trying to compile.
This process uses some C++ idioms which are not supported by my compiler version. In particular, often inside the code it is ...
1
vote
1answer
436 views
Reading the contents of the file and splitting using ksh
We're using a ksh script for installing one product.
I've another config file, I'd need to read this configuration file from my main script
Content of the Configuration file:
...
18
votes
1answer
586 views
How to implement a horizontal cat? [duplicate]
Standard cat concatenates files line by line (row by row, if you will). I find myself needing a horizontal cat command more and more often recently; i.e. a command that takes a list of files and ...
2
votes
1answer
315 views
Regarding generating intersection and union of two csv files
I have two csv files, there are some overlap columns between these two files. Assume one file is called as A.csv and another is called as B.csv. The intersection of A and B is called as C.
I would ...
2
votes
2answers
89 views
reformat a text file to have all text on one line using CentOS 5.6
I have a 210-line block of HTML that I have stored in a HTML for debugging purposes.
The HTML, as you would expect, is formatted accordingly so is stored in the file with spaces and tabs. Is it ...
3
votes
3answers
167 views
Regarding separate a single file into multiple files according to line separation
Currently, I have a plain text file, A, such as
lowest priority
very high significance.
outstanding
very novel
In this file, every line contains a sentence. I want to separate this file into ...
34
votes
5answers
12k 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
3k 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?
2
votes
4answers
167 views
Lines 1,2,3,4,…,n-1, n to lines n,n-1, …,4,3,2,1
I just realized that I could solve this problem by reversing line numbers from 1, 2, 3,...,n to n, n-1, ..., 3,2,1 and then use the same logic as earlier. So I want to know how can I reverse the order ...
2
votes
2answers
241 views
Comparing files and their properties
I get information of a certain set of files in my mail every day, which looks like this:
58623208 Sep 14 20:08 blbn_blfbe_drv
57904920 Sep 14 19:54 blbn_cycmn
55814208 Sep 14 06:02 clsa_Upd
38912000 ...
1
vote
1answer
586 views
remove carriage return character from large binary file
I have a large binary file ( nearly binary file ! ) which has many \r\n
in it [ gets Generated in windows env and doesnt have controle over generating application ]. I want to remove \r from this ...
9
votes
3answers
3k views
Delete the first n bytes of files
I've got an extreme problem, and all of the solutions I can imagine are complicated. According to my UNIX/Linux experience there must be an easy way.
I want to delete the first 31 bytes of each file ...