Skip to main content

All Questions

Tagged with
5 votes
5 answers
780 views

How can I replace multiple substrings from multiple lines in a file matching a pattern from a different file?

I have a file that contains multiple IP addresses and hostnames, and another file that contains some folders with many IP addresses per line. ip_hostname.txt host1 10.1.1.1 host2 10.2.2.2 host3 10.3.3....
Outsider's user avatar
3 votes
2 answers
282 views

Find regex occurrances on block device (line length buffer issue)

I'm trying to find all numbers on two block devices that start with a # character, are between 1635700000 and 1653699999, and end either with a null character (\0) or a linux newline (\0xA). I came up ...
user1902689's user avatar
  • 1,218
0 votes
8 answers
1k views

Rewriting log parsing script in Perl or Python (get rid of awk)

I need accomplish a task of filtering activity of bots in the log file. Solution should only show records meeting following criteria user logged in, user changed password, user logged off within ...
Twissell's user avatar
  • 141
2 votes
2 answers
119 views

Perl command Performance issue

I've used the following command to remove special characters in number columns (.CSV file) and it is working fine as excepted but the issue here is performance. My CSV file number column data contains ...
Satya Ranki Reddy's user avatar
-1 votes
4 answers
2k views

How to split columns of a CSV file into separate files?

I have csv file namely list.csv as shown below, Pcissicola19,cissicola39,12xbauhiniae BGDHLHFA_02833,DGDFDEGP_00879,POPGJMOL_04119 BGDHLHFA_01427,DGDFDEGP_03106,POPGJMOL_01558 BGDHLHFA_01618,...
Kumar's user avatar
  • 129
0 votes
3 answers
498 views

Script for formatting code into columns

Often I have code that I want to align based on similar structure of lines, not just the left-side auto indent. Is there a script out there that can do something like this? Here is an example of ...
andrewz's user avatar
  • 153
1 vote
1 answer
1k views

Escaping nested double-quotes in a corrupted CSV file

I have a large corrupted "CSV" file with many nested double-quotes. For instance: 123,"I wonder how to escape "these" quotes with backslashes.",123,456 456,"I wonder ...
Andrej's user avatar
  • 353
1 vote
1 answer
1k views

how to separate single json file to pieces of json files

We have the following json ( example 1 ) example 1 more file.json { "version": 1, "partitions": [ { "topic": "list_of_cars", "partition": 2, "replicas": [ 1003, ...
yael's user avatar
  • 13.4k
0 votes
1 answer
99 views

Delete Hundreds of thousands of files by date [closed]

I want a script that can check the age of files in different directories and delete those that exceed an expiration age. There can be hundreds of thousand of files with different creation dates. Some ...
Seth F's user avatar
  • 13
0 votes
2 answers
2k views

How to extract the key words containing row from an excel file?

I need to extract the key-words containing row from an excel file (.xls) as per the order specified in the given key-word file. For example I have an excel file namely genome.xls as given below, ...
Kumar's user avatar
  • 129
-1 votes
1 answer
226 views

NGINX - How to export the entire server block for a given domain

I need a tool or one-liner or whatever, which will export the entire server {...} block containing the given domain. For examples: ### 1) cat conf.d/domains.conf server { include http.conf; ...
don999's user avatar
  • 1
2 votes
2 answers
191 views

compare columns from two different files and PRINT RECORDS FROM FIRST FILE those that DO NOT match from second file

I would like to compare columns from file one to two. Where column 2 of file1 should un-match from column 1 or 2 from file2 and print output from file 1. file1. cat test.head20.R2.fastq.tab @...
RKK's user avatar
  • 77
0 votes
1 answer
204 views

File read, compare and replace based on comparison in text file

Hi i need guidence to write code for file processing. i have one file which having ~ as delimeter and each line is keyword is 1st column. First i have to find the lines which matches with ^6999 Then ...
Anand's user avatar
  • 41
1 vote
2 answers
512 views

How can I extract only the pid column and only the pathname column in the lsof output?

$ sudo lsof -u t | grep -i "\.pdf" evince 1788 t 37r REG 8,4 176328 134478 /home/t/some/path1/white space/string1 + string2 string3.pdf evince 3737 t 36r ...
Tim's user avatar
  • 103k
1 vote
3 answers
1k views

Find or extract text between two patterns either on the same line or in many lines

I need to print the text between two patterns without keeping in mind their place as they are found randomly across the file. either in the same line or not in the same line or a text occur between ...
Gebbo's user avatar
  • 11

15 30 50 per page