Home Man
Search
Today's Posts
Register

Showing results 1 to 25 of 500
Search took 0.06 seconds.
Search: Posts Made By: RudiC
Forum: Shell Programming and Scripting 9 Hours Ago
Replies: 17
Views: 159
Posted By RudiC
It's the order of your file2. Howsoever, try ...

It's the order of your file2. Howsoever, try
grep -B1 -ffile1 file2 | tac
T S Eliot
+440011223344
J L Borges
+330022110033
--
L Aragon
+2828288889999
Forum: Shell Programming and Scripting 10 Hours Ago
Replies: 17
Views: 159
Posted By RudiC
How far would the -f (file) option to grep get...

How far would the -f (file) option to grep get you?



grep -B1 -ffile1 file2
+2828288889999
L Aragon
--
+330022110033
J L Borges
Forum: Shell Programming and Scripting 17 Hours Ago
Replies: 3
Views: 66
Posted By RudiC
Why don't you rephrase your problem, then, so...

Why don't you rephrase your problem, then, so other members / searchers can understand it, and, en plus, post your solution so people can benefit from it?
Forum: Shell Programming and Scripting 2 Days Ago
Replies: 8
Views: 190
Posted By RudiC
It should not differentiate between small and...

It should not differentiate between small and large files. Do you have structural differences in the large files? Mayhap DOS line terminators (^M = <CR> = \r = 0x0D)? How are those files created?
Forum: Shell Programming and Scripting 4 Days Ago
Replies: 12
Views: 125
Posted By RudiC
Well, well... how about this one: for file in...

Well, well... how about this one:
for file in *.mp4
do echo /root/bin/ffmpeg -i $file $(printf -- "-i %s " $(ls "${file/.mp4}"*.srt))
done
/root/bin/ffmpeg -i FILE1.mp4 -i FILE1.da.srt -i...
Forum: Shell Programming and Scripting 4 Days Ago
Replies: 12
Views: 125
Posted By RudiC
Should ffmpeg not complain if asked to include...

Should ffmpeg not complain if asked to include /dev/null, try
for file in *.mp4
do FN=($(ls "${file/.mp4}"*.srt))
echo /root/bin/ffmpeg -i $file -i ${FN[0]:-/dev/null} -i...
Forum: Shell Programming and Scripting 4 Days Ago
Replies: 2
Views: 75
Posted By RudiC
man bash:

man bash:
Forum: Shell Programming and Scripting 4 Days Ago
Replies: 3
Views: 66
Posted By RudiC
Did you consider using the iconv tool to convert...

Did you consider using the iconv tool to convert the files between all the encodings?
And, provided a program was compiled "locale-aware", you can force it to work e.g. in the C locale by setting...
Forum: Programming 6 Days Ago
Replies: 7
Views: 121
Posted By RudiC
The sample you posted earlier seems to have a...

The sample you posted earlier seems to have a header line. And DOS line terminators (<CR> = \015 = 0x0D = \r = ^M). Try
awk -F "\t" '
{sub ("\r","")
}
NR == 1 {N = split ($0, HD);...
Forum: Programming 6 Days Ago
Replies: 7
Views: 121
Posted By RudiC
How about awk -F "\t" ' {for (N=1;...

How about

awk -F "\t" '
{for (N=1; N<=NF; N++) if ($N!="") CNT[N]++}
END {for (N=1; N<=NF; N++) print "col" N ":", CNT[N]
}
' /tmp/ex.txt
col1: 10
col2: 10
col3: 10
Forum: Shell Programming and Scripting 6 Days Ago
Replies: 17
Views: 234
Posted By RudiC
Did you check your file for DOS line terminators...

Did you check your file for DOS line terminators (<CR> = ^M = 0x0D)?
Forum: UNIX for Beginners Questions & Answers 6 Days Ago
Replies: 3
Views: 79
Posted By RudiC
Would this come near of what you need: echo -e...

Would this come near of what you need:
echo -e "MMS000101S0203430A|20180412E|\nMMB0001INVESTMENT||107-86193-01-03|\nMMB0001FUND||107-86193-04-01|\nMMC9991 " |
awk -F'|' -v OFS=, '
/^MMC9991/ ...
Forum: UNIX for Beginners Questions & Answers 6 Days Ago
Replies: 3
Views: 79
Posted By RudiC
So? Why don't you insert it into the proposal?

So? Why don't you insert it into the proposal?
Forum: Shell Programming and Scripting 6 Days Ago
Replies: 6
Views: 78
Posted By RudiC
Would this come close? sed -n 'h;n;G;p' file ...

Would this come close?
sed -n 'h;n;G;p' file
wget http://x.y.z./a
-O fileA
wget http://a.b.c./d
-O fileB
wget http://q.f.s/t
-O fileC
wget http://r.t.y/u
-O fileZZ
Forum: Shell Programming and Scripting 6 Days Ago
Replies: 6
Views: 78
Posted By RudiC
My wisdom comes from the man pages: man sed,...

My wisdom comes from the man pages: man sed, plus, infrequently, info sed.
And, DON'T forget, regular consumption of these fora! Many a trick I learned in here. Above little one copies a line into...
Forum: UNIX for Beginners Questions & Answers 1 Week Ago
Replies: 2
Views: 70
Posted By RudiC
You are overwriting the respective array elements...

You are overwriting the respective array elements with every occurrence of the respective customer. Try
awk -F"\t" '
NR == 1 {next
}

$2 ~ /grpA/ {a[$5] = a[$5]...
Forum: UNIX for Beginners Questions & Answers 1 Week Ago
Replies: 8
Views: 167
Posted By RudiC
I'm afraid neither your "expected output file"...

I'm afraid neither your "expected output file" nor the solution proposed meet your verbal specification of what you need. Why, for instance, does the first line read J6.A1 in lieu of J6.4 (taken from...
Forum: Shell Programming and Scripting 1 Week Ago
Replies: 3
Views: 97
Posted By RudiC
That missing n could indicate some non-printing...

That missing n could indicate some non-printing control char in your input file. Sure there's none? How did you create that file?


If you need the colons in your input file escaped, you could...
Forum: Shell Programming and Scripting 1 Week Ago
Replies: 30
Views: 524
Posted By RudiC
Of course, nothing is printed: You are looking...

Of course, nothing is printed: You are looking for [Ss]tate, [Hh]ostname, or [Ii]p, but your config file has FIRST_IP, FIRST_STATE, and HOST_NAME. No match possible!
On top, you should echo the...
Forum: What is on Your Mind? 2 Weeks Ago
Replies: 4
Views: 159
Posted By RudiC
I'm very grateful for the work you put in, Neo,...

I'm very grateful for the work you put in, Neo, and I wish I could join in helping, but my web programming is non existing, be it JS, PHP, HTML, or CSS.

Still, I'm collecting some bits here and...
Forum: What is on Your Mind? 2 Weeks Ago
Replies: 11
Views: 259
Posted By RudiC
Good choice, fully supported by me! ...

Good choice, fully supported by me!
Congratulations and thanks to Don for his persistent quality contributions.
Forum: Shell Programming and Scripting 2 Weeks Ago
Replies: 13
Views: 217
Posted By RudiC
Welcome to the forum. Any attempts /...

Welcome to the forum.


Any attempts / ideas / thoughts from your side?
Forum: Shell Programming and Scripting 2 Weeks Ago
Replies: 8
Views: 142
Posted By RudiC
Not sure I fully understand your request, but how...

Not sure I fully understand your request, but how far would this (using shell expansions only) get you:AMI_TAGS="env=test,country=XX,city=blah,galaxy=blahblah"
AMI_TAGS="${AMI_TAGS//,/ Key#}"...
Forum: Shell Programming and Scripting 2 Weeks Ago
Replies: 6
Views: 160
Posted By RudiC
How to identify the oldest files - by...

How to identify the oldest files - by modification time stamp? By UniqueID (if in increasing order)?




EDIT: OK, let's postpone the file identification question for now. I'd prefer a different...
Forum: Programming 3 Weeks Ago
Replies: 6
Views: 84
Posted By RudiC
Calling random seed repeatedly is sort of...

Calling random seed repeatedly is sort of overdoing it - or, in your case, even counterproductive. Do it once at program startup - if at all necessary as the compiler / interpreter may do it for you....
Showing results 1 to 25 of 500

 


All times are GMT -4. The time now is 02:56 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password