I have a csv file with lines like the followings
123456,"ABC CO., LTD","XXX"
789012,"DEF LIMITED", "XXX"
before I bcp this file to database, the comma in "CO.," need to be removed first.
My script is cat <filename> | sed 's/"CO.,"/"CO."/g'
but it doesn't work. Can anyone here able to... (2 Replies)
How can I print exactly what I want in between my quotes? I have xml that I want to echo exactly and it is not printing out the brackets and gets hung up at the "<?" and all that. Is there a way I can just say echo exactly between these quotes? (2 Replies)
Hi,
I have a requirement to replace the comma's inside the double quotes. The comma's inside the double quotes will get changed dynamically.
Input Record:
"Washington, DC,Prabhu,aju",New York
Output Record:
"Washington| DC|Prabhu|aju",New York
I tried with the below command but it... (3 Replies)
Hi, all
I need to get fields in a line that are separated by commas, some of the fields are enclosed with double quotes, and they are supposed to be treated as a single field even if there are commas inside the quotes.
sample input:
for this line, 5 fields are supposed to be extracted, they... (8 Replies)
Hello there,
I have a comma separated csv , and all the text field is wrapped by double quote. Issue is some text field contain comma as well inside double quote. so it is difficult to process.
Input in the csv file is ,
1,234,"abc,12,gh","GH234TY",34
I need output like below,... (8 Replies)
I need to use something bash related to remove everything inside of brackets.
For example. In the following:
abc<def>ghi<jkl>mno
the result should be:
abcghimno (4 Replies)
I,
I have a file and i need to replace comma and blank space with comma and 0.
cat file.txt
a,5
b,1
c,
d,
e,4
I need the output as
cat file.txt
a,5
b,1
c,0
d,0 (4 Replies)
Hi Experts,
Please support
I have below data in file in comma seperated, but 4th column is containing comma in between numbers, bcz of which when i tried to parse the file the column 6th value(5049641141) is being removed from the file and value(222.82) in column 5 becoming value of column6.
... (3 Replies)
Please use code tags
Hi,
I have input data is below format and n of column in the multiple flat files. the string data has any double quotes(") values replaced to double double quotes for all the columns{"").
Also, my input flat file each column string data has carriage of new line too.... (14 Replies)
Hi,
I have below requirement.
Apple
Orange
Banana
Required O/p in bash
'Apple,Orange,Banana'
Can you please help.
Please wrap your samples, codes in CODE TAGS as per forum rules. (3 Replies)
Discussion started by: Rtk
3 Replies
LEARN ABOUT BSD
unifdef
UNIFDEF(1) General Commands Manual UNIFDEF(1)NAME
unifdef - remove ifdef'ed lines
SYNOPSIS
unifdef [ -t -l -c -Dsym -Usym -idsym -iusym ] ... [ file ]
DESCRIPTION
Unifdef is useful for removing ifdef'ed lines from a file while otherwise leaving the file alone. Unifdef is like a stripped-down C pre-
processor: it is smart enough to deal with the nested ifdefs, comments, single and double quotes of C syntax so that it can do its job, but
it doesn't do any including or interpretation of macros. Neither does it strip out comments, though it recognizes and ignores them. You
specify which symbols you want defined -Dsym or undefined -Usym and the lines inside those ifdefs will be copied to the output or removed
as appropriate. The ifdef, ifndef, else, and endif lines associated with sym will also be removed. Ifdefs involving symbols you don't
specify are untouched and copied out along with their associated ifdef, else, and endif lines. If an ifdef X occurs nested inside another
ifdef X, then the inside ifdef is treated as if it were an unrecognized symbol. If the same symbol appears in more than one argument, only
the first occurrence is significant.
The -l option causes unifdef to replace removed lines with blank lines instead of deleting them.
If you use ifdefs to delimit non-C lines, such as comments or code which is under construction, then you must tell unifdef which symbols
are used for that purpose so that it won't try to parse for quotes and comments in those ifdef'ed lines. You specify that you want the
lines inside certain ifdefs to be ignored but copied out with -idsym and -iusym similar to -Dsym and -Usym above.
If you want to use unifdef for plain text (not C code), use the -t option. This makes unifdef refrain from attempting to recognize com-
ments and single and double quotes.
Unifdef copies its output to stdout and will take its input from stdin if no file argument is given. If the -c argument is specified, then
the operation of unifdef is complemented, i.e. the lines that would have been removed or blanked are retained and vice versa.
SEE ALSO diff(1)DIAGNOSTICS
Premature EOF, inappropriate else or endif.
Exit status is 0 if output is exact copy of input, 1 if not, 2 if trouble.
BUGS
Does not know how to deal with cpp consructs such as
#if defined(X) || defined(Y)
AUTHOR
Dave Yost
4.3 Berkeley Distribution April 29, 1985 UNIFDEF(1)