Search Results

Search: Posts Made By: raju2016
1,357
Posted By Don Cragun
If there might be multiple parenthesized sets of...
If there might be multiple parenthesized sets of data in an input file and you want to extract all of the parenthesized segments, you could also try:
awk '/^[)]/{p = 0}p;/^[(]/{p=1}' file
As...
1,961
Posted By MadeInGermany
Or, a bit more precise (regarding empty lines and...
Or, a bit more precise (regarding empty lines and empty file)
awk '/AS SELECT/ || /FROM TABLE/ {sub(/,$/,"",VAL)} NR>1{print VAL} {VAL=$0} END {if (NR) print VAL}' Input_file
1,961
Posted By RavinderSingh13
Hello raju2016, You could thank a person by...
Hello raju2016,

You could thank a person by hitting THANKS button, also please use code tags for sample Input_file. Could you please try following once.

awk '/^)$/{sub(/,$/,"",VAL);print...
2,379
Posted By RudiC
Try also awk -F. -vFMT="'%s'" '$1 != LAST...
Try also
awk -F. -vFMT="'%s'" '$1 != LAST {printf QRS FMT, $1; QRS = ORS; LAST = $1} {printf "," FMT, $2} END {printf ORS}' file
'AAA_POC_DB','TAB1','TAB2','TAB3','TAB4'
'BBB_POC_DB','TAB1','TAB2'...
2,379
Posted By RavinderSingh13
Hello raju2016, Could you please try...
Hello raju2016,

Could you please try following and let me know if this helps you.

awk -F"." -vs1="'" 'FNR==NR{A[$1]=A[$1]?A[$1] OFS s1 $NF s1:s1 $NF s1;next} A[$1]{print s1 $1 s1 OFS...
3,842
Posted By disedorgue
My solution work with correction of scrutinizer...
My solution work with correction of scrutinizer echo "$s".
Why do you want use FOR loop ?
We use a FOR loop to process a list not a line.
Otherwise, a way to process file line by line with FOR...
Showing results 1 to 6 of 6

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