No, it did work. Smart quoting, as its name suggests, is smart - it
only quotes fields that absolutely need it, which is those containing
commas, quotes or newline characters. If you want to force quoting of
a field, whether it is needed or not, you need to use the -sqf flag,
but this only applies to entire columns. There is no general way in
CSVfix of maintaining the exact quoting of input through to output.
Neil Butterworth
On Nov 14, 12:38 pm, hoainam <
hoainam.co...@gmail.com> wrote:
> Dear,
>
> Suppose I have below csv file (named input.abc):
> R1,1,"ABC",2
> R2,"MNP",3,4
> R3,5,6,"XYZ"
>
> You can see that in this file, in each record we have 01 field that
> contains Text string in double quotes.
>
> Then I use echo command (for example) to copy data to other files as below:
>
> REM --- WITHOUT -smq
> csvfix echo input.abc > output1.abc
>
> REM --- AND WITH -smq
> csvfix echo -smq input.abc > output2.abc
>
> And here the results:
>
> output1.abc
> "R1","1","ABC","2"
> "R2","MNP","3","4"
> "R3","5","6","XYZ"
>
> output2.abc
> R1,1,ABC,2
> R2,MNP,3,4
> R3,5,6,XYZ
>
> So I found that -smq did not work because if it did, output2.abc should be
> exactly the same input.abc
>
> Please support me
>
> Thanks!