Search Results

Search: Posts Made By: STCET22
6,178
Posted By RavinderSingh13
Hello STCET22, Could you please try...
Hello STCET22,

Could you please try following and let me know if this helps you(not tested though).

awk 'END{print NR+1-length(ARGV)}' *.txt
Thanks,
R. Singh
6,178
Posted By RudiC
@RaviderSingh13: Nice approach! Why not awk...
@RaviderSingh13: Nice approach! Why not awk 'END{print NR+1-ARGC}' *.txt
6,178
Posted By rbatte1
Yes, I missed the extra requirement to ignore the...
Yes, I missed the extra requirement to ignore the header record.

Can we be sure that either:-
the files all have the same header?
no files will be zero bytes?

For the former, we...
4,455
Posted By RudiC
So why the "distinct" count, all of a sudden? You...
So why the "distinct" count, all of a sudden? You didn't mention that before. How do you tell customers from each other?

As for the sum, try
echo $(( $(grep -hc customer-no *.xml | tr '\n' '+' )...
2,302
Posted By Mannu2525
You could use :- #!/bin/bash echo...
You could use :-

#!/bin/bash

echo "<<Analysis Report >>"
echo ""

echo "Src & tgt Count Validation"
echo "Source Count : `wc -l < file1`"
echo "Target Count : `wc -l < file2`"

awk -F\|...
2,302
Posted By RudiC
Why not cast everything into awk? Try awk -F\| ' ...
Why not cast everything into awk? Try awk -F\| '
BEGIN {print "<<Analysis Report >>\n\nSrc & tgt Count Validation"}

{for (i=1; i<=NF; i++) TMP[i]=$i
if...
10,203
Posted By Don Cragun
UNIX and Linux system tools use the <newline>...
UNIX and Linux system tools use the <newline> character as the line terminator; not the Windows <carriage-return><newline> character pair. So, you should get this error no matter how many file...
10,203
Posted By Corona688
Sorry for missing this. How about this: ...
Sorry for missing this.

How about this:

#! /bin/bash
#Downloading HDFS file to Local Unix & Reformatting

N=0

DIR="$1" ; shift

while [ "$#" -gt 0 ]
do
hdfs dfs -copyToLocal...
10,203
Posted By Corona688
case "$#" in 2) hdfs dfs -copyToLocal...
case "$#" in
2)
hdfs dfs -copyToLocal "$1"/"$2" .
FILE="$2"
;;
1)
hdfs dfs -copyToLocal "$1" .
OLDIFS="$IFS"
# Split $1="a/b/filename" into...
2,672
Posted By RavinderSingh13
Hello STCET22, Welcome to forum, kindly use...
Hello STCET22,

Welcome to forum, kindly use code tags for commands/codes/Inputs in your posts as per forum rules, following may help you in your requirement.

awk '{printf "%06d,",NR} 1'...
2,672
Posted By Akshay Hegde
awk '{printf("%06d%s%s\n", FNR,OFS,$0) }' OFS=','...
awk '{printf("%06d%s%s\n", FNR,OFS,$0) }' OFS=',' infile

perl -pe '$_ = sprintf("%06d,%s",$.,$_)' infile
Showing results 1 to 11 of 11

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