Search Results

Search: Posts Made By: bbc17484
1,854
Posted By vgersh99
you forgot a 'minor' detail from the...
you forgot a 'minor' detail from the suggestion....

awk '{ while(NF>3) { sub(/ /, ""); $0=$0 } }1' file_4.txt > 2.dat
1,854
Posted By Corona688
You cannot redirect to the same file you're...
You cannot redirect to the same file you're reading from.

That will truncate the file before awk runs and ruin your input as well as your output.
1,854
Posted By vgersh99
sorry... awk 'NF==3' test1.dat
sorry...

awk 'NF==3' test1.dat
1,196
Posted By Chubler_XL
The find command should get this info for you: ...
The find command should get this info for you:

find "$DIR_DATATGT_BPS" -name '*.lst' -mtime +7 -print > $DIR_TMP/Non_Updated_Files.dat
1,681
Posted By danielos
Hi! You can use also... cat Test1.dat | nawk...
Hi! You can use also...

cat Test1.dat | nawk -v var="20120912" 'BEGIN{count=0}\
{if ($0 ~ var) ++count;}
END{print count}'
1,681
Posted By RudiC
Try also$ awk '/20120912/{cnt++} END{print cnt}'...
Try also$ awk '/20120912/{cnt++} END{print cnt}' test.dat
6
1,681
Posted By Corona688
DATE="20120913" grep -c "$DATE"...
DATE="20120913"
grep -c "$DATE" filename
2,532
Posted By rdrtx1
format print. First field is string (%s),...
format print. First field is string (%s), followed by "_", followed by 2 digit decimal (%2d), folloed by "_file.csv. The variables for the fields are %TS and (date) and $SEQ (sequence number).
2,532
Posted By Yoda
TS=$( date +"%Y%m%d" ) for SEQ in 00 01 02...
TS=$( date +"%Y%m%d" )

for SEQ in 00 01 02 03 04 05 06 07 08 09
do
if [ -f "${TS}_${SEQ}_file.csv" ]
then
:
else
echo...
2,532
Posted By rdrtx1
for more bash: TS=$( date +"%Y%m%d" ) for...
for more bash:
TS=$( date +"%Y%m%d" )

for SEQ in {0..9}
do
file=$(printf "%s_%02d_file.csv" $TS $SEQ)
[[ -f "$file" ]] || echo "$file is missing"
done
1,845
Posted By rdrtx1
try also: awk '{a[$1]++;}END{for (i in a) print...
try also:
awk '{a[$1]++;}END{for (i in a) print i, a[i]}' file

---------- Post updated at 02:21 PM ---------- Previous update was at 02:10 PM ----------

or for a shell example:
#!/bin/sh
...
1,845
Posted By Yoda
sort infile | uniq -c 5 20121105 3 20121106
sort infile | uniq -c
5 20121105
3 20121106
1,397
Posted By Yoda
You can follow below steps: 1. Create a...
You can follow below steps:

1. Create a SFTP batch file:-


cat > sftp.cntrl
cd <destination dir>
ls -l *.csv


2. Run the SFTP batch file and get the count:-


count_src=`sftp...
1,703
Posted By jim mcnamara
The AWK Manual - Table of Contents...
The AWK Manual - Table of Contents (http://www.staff.science.uu.nl/~oostr102/docs/nawk/nawk_toc.html)

Is a readable explanation of awk syntax and reserved words. It gives examples of everything. ...
1,703
Posted By Chubler_XL
Use awk to match line and output the fields you...
Use awk to match line and output the fields you need:

#!/usr/bin/ksh
set -- `awk -F '|' -v N="$1" '$3==N{print $1,$2,$3}' test1.tmp`
v_ora_svr_nme=$1
v_ora_sch_nme=$2
v_srv_nbr=$3
echo...
1,703
Posted By durden_tyler
f10 is my data file and sn is a variable. ...
f10 is my data file and sn is a variable.



In that case, a good place to start is the manual:
man awk

Save the output to a file, print it out and refer to it at all times.

tyler_durden
Showing results 1 to 16 of 16

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