Issue catching/reading 2 digits and 3 letter string between brackets
Hello
I'm writing a handler for ffmpeg, and having troubles to catch some exceptions that may occour with certain files.
In order to parse for video & subtitle maps, i've had to make the raw data easier to handle, until now this worked well, but basicly i've just been lucky...
The input data is looking like this (beeing in $TMP.info):
listIDs() { # [VIDEO]
# Prints a basic table of stream ID CONTENT (and if found) LANG
# If VIDEO is not passed, it is assumed that $TMP.info contains the current data
[[ -z $1 ]] && \
cmd="cat \"$TMP.info\"" || \
cmd="StreamInfo \"$1\""
eval $cmd | while read strs maps kinds other;do
kind="${kinds:0:-1}"
lang="${maps:5:3}"
id="${maps:3:1}"
printf "$id \t $lang \t $kind\n"
done
}
Yes i am aware that strs and other are not used, but otherwise maps and kinds would contain to much data.
(for me to handle at least)
And then beeing processed by listIDs it looks like:
Code:
0 eng Video
1 eng Audio
2 eng Audio
3 eng Audio
4 eng Subtitle
5 eng Subtitle
6 fre Subtitle
7 spa Subtitle
8 ger Subtitle
9 ara Subtitle
1 (bu Subtitle
1 (cz Subtitle
1 (da Subtitle
1 (hr Subtitle
1 (fi Subtitle
1 (gr Subtitle
1 (he Subtitle
1 (hi Subtitle
1 (hu Subtitle
1 (ic Subtitle
2 (no Subtitle
2 (po Subtitle
2 (ru Subtitle
2 (sr Subtitle
2 (sl Subtitle
2 (sl Subtitle
2 (sw Subtitle
2 (tu Subtitle
2 (ru Subtitle
So, i need help to:
1) get the 2 digits shown
2) where there should be 2 digits, print all 3 letters of the language, rather than a leading '('
Thank you in advance for any advice.
---------- Post updated at 23:07 ---------- Previous update was at 23:00 ----------
lol...
Right after posting, something i've just learned recently, came up in mind....
0 eng Video
1 eng Audio
2 eng Audio
3 eng Audio
4 eng Subtitle
5 eng Subtitle
6 fre Subtitle
7 spa Subtitle
8 ger Subtitle
9 ara Subtitle
10 bul Subtitle
11 cze Subtitle
12 dan Subtitle
13 hrv Subtitle
14 fin Subtitle
15 gre Subtitle
16 heb Subtitle
17 hin Subtitle
18 hun Subtitle
19 ice Subtitle
20 nor Subtitle
21 pol Subtitle
22 rum Subtitle
23 srp Subtitle
24 slo Subtitle
25 slv Subtitle
26 swe Subtitle
27 tur Subtitle
Is there a way to change each letter of a string to the next one in the alphabet, so that a becomes b and f becomes g, and digits become one unit bigger - 4 becomes 5 and 9 becomes 0.
I want to change strings like ben123 to cfo234. (5 Replies)
Hello,
I am trying to grep string with square brackets.
for example I want to grep the below string in log.txt file.
This is a test
thanks in advance. (2 Replies)
Hi all,
I made a simple script with a prompt menu in Perl. All working good, but I want to add an option while the program is running that on every time when the user press 'Q' the program will exit.
I know I can use $SIG{'INT'} or any other %SIG option. This option is a unix signal which I... (3 Replies)
Is there a way to cnvert first letter alone in a string to upper case.
For eg: diamond should be converted to Diamond.
Thanks in Advance,
Kinny (6 Replies)
How to check whether a particular string contains dot or not?
Here I can not use grep as the string is not in a file. I will get this string from user input
Thanks, (2 Replies)
Hi,
I have a string like this user can specify different query sets that is why "or" is mentioned:
$string="](";
or
$string="]((";
or
$string="](((";
or
$string="]((((("; (1 Reply)
I use otool on OS X to figure out the shared libraries that a binary uses. I run this command:
otool -L /Applications/Vidnik\ 0.13.0/Vidnik.app/Contents/MacOS/Vidnik
And it returns an output similar to this:
/Applications/Vidnik 0.13.0/Vidnik.app/Contents/MacOS/Vidnik:... (10 Replies)
Hi,
I have created a script that has some sql queries in it. It seem to work fine and e-mails me the output file but when i use this command 'col email format a20' it creates a dead.letter file and i never get the e-mail
I am using mailx -s command to send out the e-mail.
Any help would... (0 Replies)
Hi friends!
I have a tab delimited file with two columns :
GB_45_DRB SP:0139466(mrmi sisignm)|SP:3674(fllflg_itoioh)|SP:68954779(RMTKLGF to emmdm-roomto)
GB_45_DRD SP:475928(mgmdksi rikgkg)|SP:587959(roykgl tiic-tm)|SP:0139466(mrmi sisignm)|SP:3674(fllflg_itoioh)|SP:68954779(RMTKLGF to... (4 Replies)