All Questions
13 questions
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",&...
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 ...
-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. ...
-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 ...
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....
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 ...
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;
...
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....
-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
...
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=...
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.
...
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
...
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 ...