csv - Ignoring embeded spaces with AWK -
I am searching in an easy way to print a specific field with the permission of the embedded spaces in the field.
Sample: I was able to equalize to 'code' awk '{print $ 3}' Want to be but do not give "Field Three" as a single field. Update: More specifically, the fields should not be received later on $ 3, but the location in # 3 is messing things up $ 3 in the number of spaces between the quotes is the variable What is between quotes as a field, even if not all areas have been cited, I want to be able to cure it. Therefore, if among the quotation marks the fields are ignoring the spaces as a separator. You can do this if there are double quotes always there: Specifically, I am saying If you want to go to the latter areas, you can split the remaining line on the empty space, the new array, The field's Believing your file looks like this: field 1 field 2 "field three" field 4
awk -F \ "'{print $ 2}'
awk that the field is separated from double quotes , The point at which you want it is easily available as field 2.
F [] says, J From: <$ p>
awk -F \ "'{split ($ 3, F," "); Print $ 2, F [1], F [2]} 'File Field Three Field 4 Field 5
Field1 Field2 "Field Three" Field4 Field5 Field6
Comments
Post a Comment