How can I delete a columns from a CSV file which has comma separated value with a string enclosed in double quotes or square bracket and a comma in between?
I then supplied a demonstration script to illustrate one solution with a utility called csvtool.
Quote:
Here we have space, carriage return and white spaces in permanent and current location.
You have stated a fact. You have implied that you wish to handle these with the use of awk, cut, and/or sed. You seem to be saying that those commands are OK to use, but that csvtool is not acceptable. I don't understand your basis for that, and it seems to me that it is a distinction without a differenceDistinction without a difference - Wikipedia, the free encyclopedia
The csvtool command can, in fact, handle embedded spaces, commas, and newlines. Here's an example of that using exactly the same csvtool command, but with a data file that has an embedded newline in a column that will be kept, and in a column that will be effectively deleted:
The output is as I would expect: the column to be kept with an embedded newline is still there, and the column also with an embedded newline to be deleted, is gone.
Because we don't seem to be communicating, I will withdraw and wait for someone else to reply who understands your situation better than I do.
I need help to create a csv file with Unix command.
In csv file, i need to put two values in the same cell.
Rite now, whts happening is, if i put 2 values in the same cell, its comming as " asd, zxc" but i want it in different line but in same cell.
asd
zxc
Please reply me ASAP. (1 Reply)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hi all,
I have this text file containing 9 columns separated by space. The 8th columns contains the numbers.
C1 C2 C3 C4 C5 C6 C7 C8 C9
er rt yt gh iu nk il 0.07 xs
yt lr ty bg iu zk nh 0,0005 lt
...etc.
I want to replace the comma with full stop only in 8th coloumn.
the output... (8 Replies)
logs:
"/home/abc/public_html/index.php"
"/home/abc/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
how to use "cut" or "awk" or "sed" to get the following result:
abc
abc
xyz
xyz
xyz (8 Replies)
How can I delete a column from a CSV file which has comma separated value with a string enclosed in double quotes and a comma in between? I have a file 44.csv with 4 lines including the header like the below format:
column1, column2, column3, column 4, column5, column6
12,455,"string with... (6 Replies)
I have a CSV file as shown below
"1","SANTHA","KUMAR","SAM,MILLER","DEVELOPER","81,INDIA"
"2","KAPIL","DHAMI","ECO SPORT","DEVELOPER","82,INDIA"
File is comma delimited.All the field values are enclosed by double quotes. But while using awk or cut, it interprets the comma which is present in... (6 Replies)
Okay, I would like to delete all the commas in a .CSV file (TEST.CSV) or at least substitute them with empty space, that are enclosed in double quote.
Please see the sample file as below:
column 1,column 2,column 3,column 4,column 5,column 6,column 7,column 8,column 9,column 10... (8 Replies)
Dear Ladies & Gents,
I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out:
for filename in $(find /var/log/test... (2 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)