Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: Franklin52
Forum: AIX 04-01-2016
1,559
Posted By Franklin52
Please answer these questions:
Please answer these questions:
4,186
Posted By Franklin52
$4 should not be included: awk -F\; '{f=...
$4 should not be included:

awk -F\; '{f= "sales_data" $4 ".csv"; $4=""; print > f}' OFS=\; file
5,099
Posted By Franklin52
The print command appends a newline after a...
The print command appends a newline after a string and the printf doesn't.
5,099
Posted By Franklin52
Another approach: awk -F\" 'BEGIN{print...
Another approach:
awk -F\" 'BEGIN{print "Cust-Number,Cust-Name,Cust-Town,Cust-Purchase"}
/hobby/ || !NF{next}
/purchase/{print $2; next}
{printf $2 ","}
' file
2,663
Posted By Franklin52
What have you tried so far?
What have you tried so far?
1,917
Posted By Franklin52
Another approach: awk -F, '{print...
Another approach:
awk -F, '{print NF==2?$1:$1","$3}' file
7,031
Posted By Franklin52
What have tried so far?
What have tried so far?
2,341
Posted By Franklin52
awk 'NR==3{$1=$1;print $2}' out.tmp
awk 'NR==3{$1=$1;print $2}' out.tmp
2,341
Posted By Franklin52
Try this: awk '{$1=$1}END{print $2}' out.tmp
Try this:
awk '{$1=$1}END{print $2}' out.tmp
1,182
Posted By Franklin52
Another approach: awk -F\| 'NF>8' file
Another approach:
awk -F\| 'NF>8' file
863
Posted By Franklin52
If your grep doesn't support the -A and the -B...
If your grep doesn't support the -A and the -B options you can try:
awk 'NR==FNR{if($0 ~ /error/){n=NR}next}FNR > n-4 && FNR < n+4' /home/file.txt /home/file.txt
1,670
Posted By Franklin52
Try this: awk 'NR % 6 {printf $0 FS; next}1' ...
Try this:
awk 'NR % 6 {printf $0 FS; next}1' file
1,647
Posted By Franklin52
Another approach: sed 's/[ \t]*$//' a.txt ...
Another approach:
sed 's/[ \t]*$//' a.txt

Or us CTRL-V <TAB> for \t
989
Posted By Franklin52
Please show us what you have tried so far.
Please show us what you have tried so far.
1,698
Posted By Franklin52
Use double quotes instead of single quotes to...
Use double quotes instead of single quotes to expand the shell variables:
sed -n "/$FromTime/,/$ToTime/p" $logFile > new_log.log
4,270
Posted By Franklin52
Not necessary to use ls: for i in *; do echo...
Not necessary to use ls:
for i in *; do echo "$i"; done
677
Posted By Franklin52
Please show what you have tried so far.
Please show what you have tried so far.
706
Posted By Franklin52
Something like this? awk -F\| '{NF=3}$1 ~...
Something like this?
awk -F\| '{NF=3}$1 ~ /[a-zA-Z]/{$3=NR}1' OFS=\| file
680
Posted By Franklin52
Thread closed, continue here: ...
Thread closed, continue here:

https://www.unix.com/linux/255080-small-problem.html
1,760
Posted By Franklin52
Can you show us what you have tried so far?
Can you show us what you have tried so far?
2,290
Posted By Franklin52
Try backticks `...` instead of $(...) ret...
Try backticks `...` instead of $(...)
ret =`echo Q | timeout 5 openssl s_client connect "${1`hostname`}:${2-443}" -ssl3 2> /dev/null`
614
Posted By Franklin52
With printf you can use the width trick,...
With printf you can use the width trick, something like:
date | awk '{ printf("%s %*s\n", $2, 2, $3) }'
Forum: Debian 09-28-2014
2,575
Posted By Franklin52
Something like this? echo "$BrackListAllFinal"...
Something like this?
echo "$BrackListAllFinal" | grep _Brkt$
751
Posted By Franklin52
What have you tried so far?
What have you tried so far?
877
Posted By Franklin52
Or: xargs -n1 < file
Or:
xargs -n1 < file
Showing results 1 to 25 of 500

 

Featured Tech Videos

All times are GMT -4. The time now is 02:09 PM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy