Skip to main content

All Questions

Tagged with
0 votes
2 answers
238 views

Manipulating CSVs in Unix - best native Unix tools to learn [closed]

I am new in the Unix environment. I am looking to learn manipulating CSV files (for example: adding new columns, getting values from one CSV by index and appending the value in a new CSV file etc.) in ...
Scouse_s's user avatar
0 votes
3 answers
375 views

Extract data from the nested parenthesis in bash

I'd need a way to extract certain data and store it in file for auditing and migration. Here's my data look like. network vlan internal-vlan { description "internal-use" interfaces { ...
IceAndFire's user avatar
0 votes
3 answers
1k views

Removing everything in a column after a specific embeded character in a csv file

I need to remove all the contents that appear in a column after a specific character in CSV file. This is the format it is currently in: 2020-01-01T12:00:00,Transaction Description,Initiator,$00.00 ...
dejavo's user avatar
  • 3
1 vote
2 answers
77 views

Remove duplicates csv based on first value keeping the longest line between duplicates

I have many different csv files in a folder (megadrive.txt, snes.txt) like this: Aerial Assault (USA);Aerial Assault (USA);Sega Master System;;;;;;;;;0;;;;; Aerial Assault (USA);Aerial Assault (USA);...
Isabelle's user avatar
1 vote
1 answer
1k views

Convert XLS file to CSV file in perl without using spreadsheet [closed]

I have a file in .XLS format and I want to load that file on Informatica, for which I need to convert that file to .CSV, i.e. XLS to CSV.
user359951's user avatar
0 votes
2 answers
286 views

compare two column of two different CSV file & merge the output

TABLE1.csv DATE, TIMESTAMP, ID, START TIME, END TIME, DURATION 2019-04-05, 13:57:19, 1607,13:06:42, 13:07:12, 00:00:30 2019-04-05, 13:58:00, 2327,13:57:26, 13:57:43, 00:00:17 2019-04-24, ...
Vivek Nigam's user avatar
0 votes
3 answers
7k views

remove the lines in CSV that contain specific pattern on the second field

How to remove the lines in .csv file that second field contain the word content? example : ams-hbase-log4j,content:\n#LicensedtotheApacheSoftwareFoundation(ASF)underone\n#...
yael's user avatar
  • 13.4k
1 vote
2 answers
1k views

Getting a row data from matching column in CSV file in Perl?

I am not able to attach the CSV file, so I have attached the images so that the content is clear. I used awk and perl one liners but that is not giving any output. Please help me know, how can I get ...
Dipit Sethi's user avatar
1 vote
2 answers
3k views

Fixing malformed CSV with incorrect new line chars using sed or perl only

I have a comma-delimited CSV file but for some reason our system inserts a new line character at a random location in the file which causes the entire file to break. I can get the number of columns in ...
Harry McKenzie's user avatar
39 votes
17 answers
37k views

Converting CSV to TSV

I have a number of large CSV files and would like them in TSV (tab separated format). The complication is that there are commas in the fields of the CSV file, eg: A,,C,"D,E,F","G",I,"K,L,M",Z ...
user avatar
0 votes
2 answers
195 views

awk + how to convert CSV names to one field names

I have the following csv file more names.csv erik kastelo , roman flot , david krish , timoty klon derek matue , jenfaer loper , kris dovalo sara paula , boris miue , kami san-toto , benjaman ...
yael's user avatar
  • 1,529
0 votes
1 answer
128 views

Transpose CSV file by the value of a column

Input: X Y 1 11 1 12 2 21 2 22 Desired Output: 11 12 21 22 I want to transpose the CSV file by the value of column 1. In this example, for X = 1, transpose (11, 12)^T to (11, 12); for X = 2, ...
Jill Clover's user avatar
0 votes
3 answers
425 views

Print/export csv file into array

I have the following data in a very large csv: "sortorder","name","description" "1","B.1","Boiler room" "2","1.1","First office" "3","1.2","Second office" etc... Which I would like to end up in ...
Martin's user avatar
  • 1
1 vote
1 answer
723 views

Cut a specific part of a column from a csv file [closed]

I have to process a csv containing about 15 columns one of which contains a particular timestamp that includes milliseconds. When I go to insert this csv into a DB, I get an error because of this ...
fabiousaol85's user avatar
4 votes
3 answers
5k views

replace column of a csv file with column from another file

I have two sample files like this: $ cat file1 abc,sachin cat,kumar $ cat file2 xyz pressure $ cat file3 xyz,sachin pressure, kumar I want the first column of file1 to be replaced with file2. ...
praveen's user avatar
  • 91

15 30 50 per page