Search Results

Search: Posts Made By: Prit Siv
4,009
Posted By Prit Siv
question
Thank you so much! Both RudiC and Aia's solutions work, howeverwith the awk solution, the second line prints

,0,0

and with the perl solution the last line prints

,0,0
Can someone explain...
4,009
Posted By Prit Siv
solution
its not working correctly, in the middle of the file it prints the header in one of the rows, and the first line is ,0,0

my csv file has headers so i added NR==1

still no luck
4,009
Posted By Prit Siv
awk command to manipulate csv file in UNIX
Hi, I am new to awk and unix programming and trying to manipulate a csv file.

My current csv file looks like this:

col1,col2,col3,col4,col5,col4,col5,col6,col7,col8
223,V,c,2,4,f,r,,y,z...
8,353
Posted By Prit Siv
@Chubler_XL, I tried dos2unix file2.csv and sed...
@Chubler_XL, I tried dos2unix file2.csv and sed -i 's/[[:space:]]*$//' file2.csv but still receiving the same output..

---------- Post updated at 09:46 AM ---------- Previous update was at 09:22...
8,353
Posted By Prit Siv
@Franklin52 and @Chubler_XL thanks for your...
@Franklin52 and @Chubler_XL thanks for your replies!

File 1 currently does not have a ID column. This ID column has to be inserted. @Franklin52, when I try tried your approach, the outout is...
8,353
Posted By Prit Siv
code so far
I tried to do something like this:

awk -F, 'FNR==NR{a[$2]=$1;next}$1 in a {$7=a[$1]}1' OFS="," FS="," file2.csv file1.csv

The output is completely wrong though :(

Have not written any awk...
8,353
Posted By Prit Siv
awk script to perform an action similar to vlookup between two csv files in UNIX
Hi,

I am new to awk/unix and am trying to put together an awk script to perform an action similar to vlookup between the two csv files.

Here are the contents of the two files:

File 1:
...
2,006
Posted By Prit Siv
save csv in other file
That worked perfectly!! Thank you so much!! :)
2,006
Posted By Prit Siv
awk command to manipulate csv file in UNIX
Hi,

I am new to awk/unix and am trying to put together a script to manipulate the date column in a csv file.

I have file1.csv with the following contents:

Date,ID,Number,Amount,Volume,Size...
Showing results 1 to 9 of 9

 
All times are GMT -4. The time now is 07:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy