Skip to main content

All Questions

Tagged with
2 votes
3 answers
463 views

Convert mm to hh:mm

I am using awk to get all of the 4th comma-delimited fields, which is a duration in minutes. The required output is in the format of hh:mm, so I need to convert that from minutes. "jone",&...
SRash's user avatar
  • 111
0 votes
0 answers
88 views

Keep every process in 1 execution block in CSV handling

I asked some questions about how to handle a csv file and this result was numerous processes. Every month I get several TXT files in a Google Drive directory. I need to process, unite and load this ...
matheus soares's user avatar
-1 votes
2 answers
39 views

Match the column values without seeing the orders

I am trying to compare the value of two columns without seeing the order of it. I tried with summing the values and matching them if matches then putting Match otherwise Nomatch in additional column. ...
RKK's user avatar
  • 77
-1 votes
8 answers
3k views

Querying csv files like sql

This is apparently a popular interview question: There are 2 CSV files with dinosaur data. We need to query them to return dinosaurs satisfying a certain condition. There are 2 choices - use only Unix ...
d-_-b's user avatar
  • 117
1 vote
2 answers
890 views

Find value from array in one file, look up value in another file, and then use that value to find another and set as variable

So I have two files, file 1 looks like this: RR1.out RR2.out RR3.out RR4.out RR5.out RR6.out 45.7597 45.7646 45.4453 45.4448 45.2081 45....
Pyrodancer123's user avatar
1 vote
2 answers
397 views

Awk or Sed: If pattern is found: delete line && export variable

In my bashscript I want Sed to find debug: Debug in a file ${SourceP} and if found delete that line and export to the environment Debug=Debug sed -i '/debug: Debug/,+0 d' ${SourceP} && export ...
Porcupine's user avatar
  • 2,146
0 votes
2 answers
1k views

Print file line-by-line, but handle the file changing mid-execution

The following bash command reads the input file then prints each line with a 15 second pause between them: IFS=$'\n';for line in $(cat file.txt | tail -n +2); do echo $line && sleep 15; done; ...
bioinform's user avatar
107 votes
8 answers
237k views

How do you list number of lines of every file in a directory in human readable format.

I have a list of directories and subdirectories that contain large csv files. There are about 500 million lines in these files, each is a record. I would like to know How many lines are in each file....
Hexatonic's user avatar
  • 1,315
-1 votes
1 answer
820 views

Python output in XML format

I have a python script which compare IP list with IP Database and gives output of matching criteria. (I got the script from this forum). convert.py #!/usr/bin/python import socket,struct ...
Karthik's user avatar
  • 153
2 votes
1 answer
110 views

how can I add an extra character after a word search [closed]

I have the following field names demelog voyapro naisjdf naismc decoide decoccm travide travccm equiccm mariccm Below is a sample of my file. There are more columns before the first fck=83... fck=...
Andy K's user avatar
  • 179
2 votes
1 answer
2k views

Safely convert unicode strings to printable characters

I have many HTML files containing mixed unicode strings like \303\243 and printable characters like %s. What I'd like to do is converting the unicode strings into printable characters in a safe way. ...
admirabilis's user avatar
  • 4,782
4 votes
6 answers
1k views

What is the easiest way to check if column A and B values goes both ways with AWK? [closed]

What is the easiest way to check if column A and B values goes both ways? Output to check: Mike John John Mike Pamela Barbara Barbara Pamela Mike Paul Roger Paul Desired output Mike <-> John ...
tiny's user avatar
  • 823
4 votes
5 answers
739 views

Align a hex text file at 9 bytes each line

I want to align the selected portion of a text file at 9 bytes each column. For example suppose my text file looks like below. 00 2f c6 b8 29 fd 02 37 11 00 9f 74 34 0b 60 72 38 20 00 9e 61 33 8e ...
liv2hak's user avatar
  • 163