Search Results

Search: Posts Made By: ritesh.bhawsar
11,181
Posted By ritesh.bhawsar
Code: awk -F'"'...
Code:
awk -F'"' 'BEGIN{OFS="\""}{gsub(",","|",$2);print}' file.csv
awk: syntax error near line 1
awk: illegal statement near line 1
11,181
Posted By ritesh.bhawsar
@Sheel, the code you gave is giving me syntax...
@Sheel, the code you gave is giving me syntax error :(

Can this be done by writing a script if a one line command is not possible.
11,181
Posted By ritesh.bhawsar
Thanks Sheel... But it's possible that I have...
Thanks Sheel... But it's possible that I have more that one fields wrapped inside in the last column as well, I need to somehow escape commas inside "". Really appreciate if you can provide an...
11,181
Posted By ritesh.bhawsar
I tried cut -d but it takes the commas inside ""...
I tried cut -d but it takes the commas inside "" as well in count
while read line
do
OUTLINE=`echo $line | cut -d, -f1`","`echo $line | cut -d, -f4`
echo $OUTLINE
done < file.csv

I get...
11,181
Posted By ritesh.bhawsar
How to avoid Delimiter occuring in column values in .csv file
Hello Gurus,

I need to create a file from a .csv file extracting specific columns only.

File structure is
Column1,Column2,Column3,Column4
abcd,1234,"asdf, tew,123",123456...
Showing results 1 to 5 of 5

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