4
votes
1answer
40 views

Truncated result returned by JOIN

I'm using join command under linux, but the results vary between different machines. I have two simple files: cat 1.txt a aaa,0.2 b bbb,0.3 c ccc,0.5 cat 2.txt a aaa,0.2 b bbb,0.3 c ccc,0.6 I'm ...
2
votes
2answers
205 views

Remove all lines in file A which contain the strings in file B

I have a CSV file users.csv with a list of userNames, userIDs, and other data: username, userid, sidebar_side, sidebar_colour "John Lennon", 90123412, "left", "blue" "Paul McCartny", 30923833, ...
2
votes
3answers
412 views

How to replace the content of specific column with awk?

Given there is 40 columns in a record. I want to replace 35th column so that the 35th column will be replace with the content of 35th column and a "$" symbol. What came up my mind is like: awk ...
3
votes
1answer
52 views

comparing columnn values between two unix files

File A Table SAPSR3./1BEA/BBEA_BDH has no BasicFile LOB columns Table SAPSR3./1BEA/BBEA_BDI has no BasicFile LOB columns Table SAPSR3./1BEA/BBEA_DLI has no BasicFile LOB columns Table ...
0
votes
4answers
85 views

What are alternative tools for searching files in full content?

I realized that most of the text related tools I use, grep/egrep/awk/sed are line-oriented. I guess that is a simplified approach to search in files but I was wondering if there is another set of ...
1
vote
1answer
222 views

how to subtract a constant value from a data file?

I want to subtract a constant number from my data to get new data file. For example, I want to subtract 10 from my data. data.txt Id a b c d e 1 1 2 3 4 5 2 2 3 4 5 6 ...
1
vote
3answers
212 views

How to calculate the sum of the data that have the same ID in the first column?

I want to sum the values of the rows of my data that have the same ID in the first column. My data looks like data.txt Id a b c d e 1 1 2 3 4 5 1 2 3 4 5 ...
0
votes
2answers
106 views

How to Lookup the values of an index values from a big data file?

I have a data file (data_array.txt in the example) and index file, index.txt, at which I want to extract the data from the data file that have the same ID in the index file and store in to a new file, ...
1
vote
3answers
92 views

a string representation using regex (modified)

I would like to use regular expression to represent a pattern with the following type of characteristics 1) It includes a continuous sequence of digit values. The length of this sequence it at least ...
4
votes
3answers
289 views

OS X/Linux one-liner/script to find the largest recurring group of lines in a text file?

I have a log containing an execution trace where there is infinite recursion eventually terminating when the stack is too deep. There are enough lines and valid included recursion within the larger ...
3
votes
3answers
153 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 ...
3
votes
1answer
3k views

Command to transpose (swap rows and columns of) a text file [duplicate]

Is there currently a generic command that will "pivot" input. e.g. #labeled.file name: bob title: code monkey name: joe title: pointy haired is converted to: name title bob code monkey joe ...
0
votes
2answers
208 views

Is it against linux ethos to provide a progress indicator for running commands? [duplicate]

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 ...
2
votes
1answer
588 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 ...
3
votes
1answer
2k views

How to do multiline search and replace text (delete) recursively

I want to go recursively through a directory and search for specific content in all files. The content should then be replaced if found. With a single line I would make something like this: find . ...
3
votes
2answers
3k views

Why does xargs strip quotes from input?

Why does xargs strip quotes from input text? Here is a simplified example: echo "/Place/='http://www.google.com'" | xargs echo outputs /Place/=http://www.google.com Is there any way to ...
3
votes
3answers
285 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 ...
9
votes
5answers
3k views

Randomly draw a certain number of lines from a data file

I have a data list, like 12345 23456 67891 -20000 200 600 20 ... Assume the size of this data set (i.e. lines of file) is N. I want to randomly draw m lines from this data file. Therefore, the ...
0
votes
2answers
3k views

list the difference and overlap between two plain data set [duplicate]

Possible Duplicate: Linux tools to treat files as sets and perform set operations on them I have two data sets, A and B. The format for each data set is one number per line. For instance, ...
3
votes
2answers
240 views

join files with numbered index

I am trying this command: join -a1 -11 file1 file2 > file3 file1 looks like: 1 2 3 4 5 6 7 8 9 10 11 file2: 1 lkj klj lkj 2 lkj lkj lkj 3 7 lkj lkj lkj 8 9 11 ...
2
votes
5answers
5k views

How to get netmask from bash?

I want to get my netmask on Linux. It is outputted with ifconfig but I want to extract the string.
0
votes
1answer
982 views

Convert text to image in centos from bash

I want to create an image [jpg, png, doesn't matter] from shell but I don't have convert command. The image is very simple - white background with a medium-size black text in the middle. Is it ...
7
votes
1answer
2k views

How to remove duplicate lines in a large multi-GB textfile?

My question is similar to this question but with a couple of different constraints: I have a large \n delimited wordlist -- one word per line. Size of files range from 2GB to as large as 10GB. I ...
2
votes
1answer
292 views

rotating buffer type file logging utility

I'am trying to debug a server that throws a lot of logs on stdout/stderr. I need to redirect only last N lines to a file. Something like a rotating buffer feature there in tcpdump's -C & -W flags. ...
5
votes
1answer
113 views

Search for a text in Linux but don't display the complete line in results

I'm using grep to do this, like: grep someText file.log But this returns the complete line in results. If someText is found in the middle of a line I don't want to ouput the whole line, just the ...
3
votes
2answers
707 views

How can I count lines with title-case words of certain length?

How can I create a shell script in unix/linux to find the number of lines in a text file that have words which are 5 to 10 character long and begin with a capital letter?