I have very big logs (several gigabytes per day), that can (but do not need to) contain specific lines. I have to count the number of occurences of every one of these lines on a daily basis.
I have a file patterns.in, that contains the desired lines.
Hello. I have this file:
XXXX
1 AAAA
2 BBBB
3 CCCC
4 DDDD
YYYY
1 AAAA
2 BBBB
3 CCCC
4 DDDD
Desired output:
XXXX AAAA
XXXX BBBB
XXXX CCCC
XXXX DDDD
YYYY AAAA
YYYY BBBB
YYYY CCCC
YYYY DDDD
Any help would be appreciated.
I am new at shell script. I have a file containing some records like this:
aaaa,-1,0
bbbb,2,3
cccc,-5,-10
dddd,0,100
I want to write a script that will make the list look like this:
1 aaaa -1 0
2 bbbb 2 3
3 cccc -5 -10
4 dddd 0 100
Can someone help me regarding this?
Thanks
Hi,
I am having a file in the following format.
I have the following folder structure:
/AAAA/BBBB/1111
/AAAA/BBBB/2222
/AAAA/BBBB
/AAAA/CCCC
/AAAA/DDDD/3333
/AAAA/DDDD
/AAAA
I want to get the size of these folders, but just from the folders and subfolders. I dont't need the sub-subfolders, which in my example are 1111, 2222 and 3333.
I can do that with "du -m", but it shows me the entire tree, not just 2 levels as I need.
I have this bash:
replace="s/AAAA/BBBB/g";
find myDirectory/. -type f -print0 | xargs -0 sed -i $replace;
that will recursively scan myDirectory tree and replace all occurrences of AAAA with BBBB on the files there.
But I want to limit this to happen on files of specific extensions, for example, .txt, .read, .po
How do I impose this limit?
thanks
I have output from a foreach loop in the form:
ABC123603LP 44Bq AAAA
ABC123603P 3BU AAAA
ABC123603ZZP AAAA
ABC123604DP 3BU BBBB
ABC123604LP 44Bq BBBB
ABC123605AP 4q CCCC
ABC123605DP 33BGU CCCC
ABC123606AP 35Bjq DDDD
ABC123606DP 4B DDDD
From this I wish to print columns 1 and 2 to the term
Hello. I have a file of text with columns:
Code:
aaaa bbbb ccc dddd
aaaa bbbb ccc dddd
aaaa bbbb ccc dddd
How can this be converted to a .csv file?
Thanks
Having a file of the following contents:
1111,2222,3333,4444
aaaa,bbbb,cccc,dddd
I seek to get a file equal to the original but lacking a n-th column like, for n = 2 (or may it be 3)
1111,2222,4444
aaaa,bbbb,dddd
or, for n = 0 (or may it be 1)
2222,3333,4444
bbbb,cccc,dddd
A real file can be gigabytes long having tens thousands columns.
As always in such cases, I suspect command line mag