All Questions
22 questions
2
votes
7
answers
2k
views
How to remove embedded newlines from CSV fields
I am struggling with processing a file. Normally I should have a line for each host definition. But sometimes, someone split some fields on different lines.
Here is an example:
"host1","...
4
votes
4
answers
1k
views
Regex match shell variable as a pattern (case insensitively)
A snippet of a typical tsv file I have used
10 Interstellar Main Theme Extended UDVtMYqUAyw
11 Journey XvG78AmBLc4
12 Jurassic Park Music & Ambience Amazing Soundscapes and Music ...
0
votes
2
answers
665
views
Use awk to select only select lines with one field smaller than threshold from CSV file
Dealing with the post-processing of multi-column csv file contained many (10000+) lines:
ID(Prot), ID(lig), ID(cluster), dG(rescored), dG(before), POP(before)
9000, lig662, 1, 0.421573, -7.8400, 153
...
-1
votes
2
answers
54
views
comparison to get only lines with changed values on a column
Given the following two csv files, previously sorted:
file1
a,1,val1
b,2,val2
c,3,val3
d,4,val4
e,5,val5
f,6,val6
g,7,val7
file2
a,1,val1
b,2,val2
c,3,val3x
e,5,val5x
g,7,val7
h,8,val8
How can I ...
-1
votes
2
answers
262
views
Copy column B if column E or F is empty or comes with value 0
I have a CSV file, and I want to use a bash with command awk or anything else to modify this file.
For example, I want to copy column B if column E or F comes empty or with the value of 0
AAAA, BBBB, ...
11
votes
7
answers
8k
views
How do I keep the first 200 lines of all the csv files in a directory using bash?
I have around 50 very large csv files, they have thousands of lines.
And I only want to keep the first 200 lines for each of them - I'm okay if the generated files to overwrite the original ones.
...
3
votes
4
answers
3k
views
Unix file with newlines within quotes
I've got a CSV weird file with quotes within quotes and newlines and what not in one single column. Now I need to identify that column with "newlines" as one column and replace newlines with some ...
0
votes
3
answers
277
views
AWK csv manipulation
I have a csv file containing something like this:
abc;!!!!;22
abc;!!!!;23
23;!!!!!;22
Now I want to delte every line that contains a 23 in the third column.
Since there is a possibility that there ...
2
votes
1
answer
856
views
Populate a CSV file from data file with nested loops in bash
I have a file, 4.txt that contains full paths to *.cfg files as well as additional data I need to strip for the final report (5.csv).
For example /source/EDDG/env1/dom1/proj/config/test.cfg
<...
2
votes
4
answers
5k
views
Count repeated occurrences in a CSV?
I have a CSV with columns that look like the following:
Team Other Data More Data Result Time
Knicks A F Loss 2p
Celtics B E Win 2p
Lakers ...
4
votes
4
answers
5k
views
Merge multiple CSV files with partially matching key column
I have 100 csv files each containing 2 columns. The first is taxonomy and the second counts. Each file has about 10000 rows. The taxonomy data in each file is only partially shared with a total of ...
0
votes
1
answer
5k
views
Creating Users from a .csv file [duplicate]
I'm trying to create users by importing their data from a .csv file by using a bash script. I know basics for bash but I'm getting confused using loops to create this script. The template for the .csv ...
1
vote
3
answers
2k
views
Bash script to convert the 2nd column in csv file from Unix time to readable date / time
My input file is a comma separated .csv.
I'd like to convert the 2nd columns from unix time to a readable date time format like this...
before 1502280000
after 8/10/17 08:00:00
I'd also like to ...
2
votes
1
answer
91
views
Take info from .csv file and add it after certain pattern
I am working with this student's info:
name: Romeo
e_mail: [email protected]
Room: 0/48
street: 1/0/48
name: April
e_mail: [email protected]
Room: 0/4
street: 1/0/4
name: Julian
e_mail: ...
1
vote
2
answers
2k
views
awk taking file names instead of files in for loop
Okay so I need to extract a certain column with awk from a certain file, put it in an array and then sort it, and afterwards I would need to look up some values within these extracted sorted columns ...