All Questions

Tagged with
Filter by
Sorted by
Tagged with
0votes
4answers
1kviews

Grep and Cut command in linux

I have a csv file with loads of data. I wish to cut the 9th column for values >=1 and then use grep to display full rows that match. Sample format: ABC,XYZ,RTY,CREAM,FRANCE,170019,ST REMY CREME,...
0votes
1answer
46views

How to split single rows of a CSV file into multiple depending on delimiter in 2nd column

My base.csv file has several entries a sample of which is below. NAME,IP_ADDRESS,PRI_IP,APP_CODE,APP_NAME,OWNER test2,10.9.7.12/10.222.101.11,10.9.9.12,545,myapp1,owner1 mytest,10.9.7.12,10.9.9.12,545,...
  • 217
0votes
1answer
295views

Use first column as header for csv

I have an input file as follows hello: hello12 foo: bar14 test3: pppp more: stuff test14: bla Is there a way to use the first column as header and separate it by comma's as follows: hello,foo,test3,...
  • 583
6votes
3answers
7kviews

How to use Unix Shell to show only the first n columns and last n columns?

I have many csv files. The original design was supposed to have five columns. I just found out that the middle column of the csv file has a string with arbitrary number of commas in it and it is not ...
4votes
3answers
2kviews

how to replace the first element in a CSV with a sequential number?

I have a csv file like this: 5/05/2017;03;07;30;35;43;01;03 9/05/2017;08;12;16;22;26;06;07 12/05/2017;02;20;28;29;44;03;09 16/05/2017;08;11;15;20;30;03;08 19/05/2017;09;11;12;19;30;04;09 23/05/2017;...
  • 4,174
-2votes
1answer
786views

Need to print value from 12th column of a particular row that matches two variables in a CSV file [closed]

Consider below two variables DC="777777" CountryCode="IN" Have a CSV file, fileSB.csv. I found a command (below) to search for the DC variable name in 2nd column and CountryCode variable name in 4th ...
3votes
2answers
828views

How to merge two files based on the matching of two columns? CSV

I have file1 likes: 6688249-7,03/02/2017,5515,02-feb-17 16914917-8,03/02/2017,5521,02-feb-17 And a file2: 5515,6688249-7,06-02-2017 04:25:47 PM,ASIG,ELIZABETH PRIETO 5515,6688249-7,06-02-2017 04:56:...
5votes
3answers
28kviews

Search for values in 2 columns from CSV

I have a csv files with say 20 odd columns. I need to get the 14th and 15th column values where value in 14th column is say "VALUE1" and value in 15th column is "VALUE2". My condition gets satisfied ...