Skip to main content

All Questions

Tagged with
-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-...
Raman Kathpalia's user avatar
-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: ...
dante_t's user avatar
  • 151
-1 votes
1 answer
59 views

Returning lines from a JSON log file which contain IP and timestamps read from a CSV file?

so I'm new to Shell Scripting and could use some help. So in my CSV file, I want to see if IP and timestamp values exists in some way in the line entries of the JSON log file, and if so, return that ...
Linuxnoob's user avatar
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 ...
pierogie's user avatar
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},...
xorghelpneed's user avatar
2 votes
5 answers
395 views

how to turn multiple URLs into domains with command line

I have .csv files with multiple columns and ',' as separator. The url's are in the first column. I need to turn all url's into domains without removing the other columns Example of the data I have: ...
xorghelpneed's user avatar
0 votes
2 answers
2k views

Parsing CSV with AWK, returning fields to bash var with line breaks

I have to migrate a password database (Keepass) by using a csv file of it, to a new application by using its API. The API is updated with post requests, those needs JSON data format. What I need to do ...
Plourfi's user avatar
1 vote
2 answers
3k views

Write values with embedded commas from arrays into CSV file using BASH

I am trying to write different arrays into a csv file ($file) columns. Each array has the same number of values. For example, arr1 and arr2 have 3 values each arr1=( 23 45 34 ) arr2=( "abc,d"...
Lilek3's user avatar
  • 11
2 votes
1 answer
114 views

awk to return percentage by day of the week [closed]

So I have a dataset of flights in a CSV file and I want to get a percentage of flights delayed (column 6) ordered by day. 0 is for not delayed and 1 is for delayed 15 or more minutes. Input: ...
Llem Colop's user avatar
-1 votes
2 answers
256 views

Compare two csv files containing floating-point data and print their difference statistics

I have two csv files: a.csv and b.csv. Both these files contain same set of rows. For example: a.csv: Yield 5.68 1.34 1.47 9.01 7.59 b.csv: Yield 5.68 2.01 0.78 7.98 8.17 I need to compare these two ...
Coder's user avatar
  • 179
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,...
dante_t's user avatar
  • 151
1 vote
1 answer
2k views

How can I use a variable in awk command

With my code I am trying to sum up the values with the specific name of a column in a csv file, depending on the input of the name. Here's my code: #!/bin/bash updatedata() { index=0 while ...
anonymous's user avatar
0 votes
5 answers
4k views

how to check validation of csv file with two fields

I have simple csv file that should contain only two non-empty fields as the following This is example of right csv file $ more file.csv why_we_need_help,log_low=53687091200 whats_is_going_on,...
yael's user avatar
  • 13.9k
1 vote
2 answers
7k views

Remove URI prefix (http:// and https://) by using awk command or shell script

I have the below data (Actual output) http://localhost:5058/uaa/token,80 https://t-mobile.com,443 http://USERSECURITYTOKEN/payments/security/jwttoken,80 https://core.op.api.internal.t-mobile.com/v1/...
Kalpana Pinninty's user avatar
3 votes
3 answers
642 views

How to parse Stdout as a mix of CSV and JSON?

I'm currently working on a class that has us submit our code to an auto-grader and then returns our results. The format it returns is kind of hard to visually parse, so I would like to write a script ...
dylanjm's user avatar
  • 211

15 30 50 per page