This works fine, but it does leave a trailing comma instead of a newline.
It would not hurt to use !/^i/ which would provide extra security here, even though it is not required with this particular input.
Hi all,
Am new to scripting. So i just need your ideas to help me out. Here goes my requirement.
I have two csv files
1.csv 2.csv
abc,1.24 abc,1
def,2.13 def,1
I need to compare the first column of 1.csv with 2.csv and if matches then need to compare... (2 Replies)
Hello,
I have a file that lists a few hundred values.
Example:
abca
abcb
abcc
abcd
I have a 2nd file with a few thousand lines. I need to remove every line from the 2nd file that contains any of the values listed in first file.
Example of strings to delete:
line1 *abca* end of... (1 Reply)
Dear Friends,
I have a command which can result following output.
Packet is: /var/adm/yyyy/pkt6043
Intended for network : /vob/repo
I would like to retrive
pkt6043 and /vob/repo using single command.
Blue color test will be always contstant and red color text will be dynamic
... (2 Replies)
Hi,
I have an csv file and there are some non printable characters(extended ascii) so I am trying to create a clean copy of the csv file . I am using
this command:
tr -cd "" < /opt/informatica/PowerCenter8.6.0/server/infa_shared/SrcFiles/ThirdParty/locations.csv > ... (4 Replies)
Hello,
Does anyone have a one-liner to remove lines of a csv file if the value in a specific column is zero? For example, I have this file,
12345,COM,5,0,N,29.95,Y
12345,MOM,1,0,N,29.95,Y
12345,COM,4,0,N,9.99,Y
12345,MOM,0,2,N,9.99,Y
12345,REN,0,1,N,9.99,Y
and I want to remove lines... (4 Replies)
Hi all,
I wrote the following code to remove the value which are 0 in the input file (a columns if numbers).
awk 'BEGIN {
for (i=1; i<=NF; i++)
if ($i)
printf("%13.6e\n",$i)
}' $1 >> $2
The script works if the zeros are written as
0.0000
but not as
0.000000e+00
In... (10 Replies)
Hi,
I have a requirement like my .csv file is generating from a db2 table using export command like below:
file format:
-----------
2011 4 0 0 N S C C "BHPC
BHPC" 0 0 0
2011 5 0 0 N S C C "BHPC
BHPC" 0 0 0
here BHPC is having new line character and because this when i am trying... (4 Replies)
Hello Everyone,
I am trying to find a way to take a .csv file with 7 columns and a ton of rows (over 600,000) and remove the entire row if the cell in forth column is blank.
Just to give you a little background on why I am doing this (just in case there is an easier way), I am pulling... (3 Replies)
Hi
I'm creating a sh script to generate a csv file. The CSV contains the values from a sql table.
The content looks this:
a,b,c,c2,c3,,,,,,,,,,,d,e
I have some code that can separate the fields using the comma as delimiter, but some values actually contain commas, such as... (2 Replies)