All Questions
62 questions
-3
votes
2
answers
100
views
Using awk, append a value in last field in csv file based upon value in specific field
input.csv -
"family_guy","Brian","b47f0a80-d848-4d81-a45b-7ba930e6048b","son"
"family_guy","Brian","b47f0a80-d848-4d81-a45b-...
-1
votes
1
answer
195
views
Create new CSV files based on latest timestamp data
I have a script that accesses multiple dat files and produce csv files based on previous day’s data. these DAT files are updated on per minute bases with data from various instruments.
Script snippet:
...
0
votes
2
answers
1k
views
Commands runs in shell, but not in script: no directory found error
I have a few commands that don't run as a script.
It's supposed to create a bulleted list of the file names, then sort the columns of each file alphabetically, grab the second and its matching third ...
0
votes
0
answers
101
views
Personalize .txt files with data taken from a .csv file. (Replacing variables)
I want to customize text files for a big list of people. The dirs and files are made already. For each person there are 6 text files. The 6 text files together contain 7 variables: ${FULLNAME}, ${DOB},...
3
votes
1
answer
2k
views
Filter one very large CSV based on values from another CSV
I am processing some CSV files that do not fit in RAM.
The 2 CSV files have the following structure:
first.csv
id
name
timestamp
serial
str
yyyy-mm-dd hh:mm:ss
second.csv
id
name
date
serial
str
yyyy-...
2
votes
2
answers
886
views
Comparing with csv file value
I have a csv file and I need to compare the value in 4th column of 2nd row with a string.
Sample csv file:
Col1,Col2,Col3,Col4
Val1,Val2,Val3,ValNeeded
I'm using the below code to perform this,
...
1
vote
2
answers
121
views
Converting files in multiple directories from tab separated to comma separated
I am running Mac OS.
I have a directory /Users/sethparker/Documents containing several subdirectories /Users/sethparker/Documents/dir1,/Users/sethparker/Documents/dir2,/Users/sethparker/Documents/dir3....
1
vote
3
answers
2k
views
Concatenate N number of csv files to one single csv file
I have a requirement to build a shell script which would concatenate all available CSV files into one. All these CSV files have a similar structure (i.e same headers and number of columns) and these ...
-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 ...
4
votes
2
answers
2k
views
How to split CSV file and create multiple CSV files based on a column
I have a csv file with the format:
Input.csv:
TIMESTAMP,Data1,Data2,Data3,Data4
"2021-01-03 00:00:00",80953,3.243183,2.943338,358.0123
"2021-01-03 00:01:00",80954,2.173187,1.990327,...
-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, ...
1
vote
1
answer
557
views
Replace several characters in a text file using specific row and column values of a csv
I have a .txt file with different entries such as region1a, region1b, region2a, region2b etc.
I have an excel file with different column and row values. I want to use a particular row and column value ...
-1
votes
3
answers
250
views
Issues related to grep command looping for multiple csv files
I made a for loop script as shown below,
for file in *.csv
do
grep raxA $file > new_${file}
done &&
mkdir raxA && mv new_* raxA &&
for file in *.csv
do
grep raxB $file > ...
0
votes
2
answers
468
views
Remove all rows in a CSV file without corresponding/matching timestamp in another CSV file
I have 2 CSV files which look like follows:
file1.csv
col1,col2,col3,col4,date,time,col7
1,2,3,4,2019-07-20,12:40:00,0
1,2,3,4,2019-07-20,12:43:00,0
1,2,3,4,2019-07-20,12:44:00,0
1,2,3,4,2019-07-20,12:...
1
vote
1
answer
333
views
Get a list of file name, and compare to a csv file while adding 2nd and 3rd column of the same 1st column
I have a csv file that looks like this:
user1,400,300
user2,250,250
user3,400,300
user1,400,300
user4,400,300
user2,250,250
and a directory that has a empty file named after the user
$ ls /dir/*
/dir/...