Sponsored Content
Top Forums Shell Programming and Scripting Combining two perl commands into one Post 303045726 by bedtime on Friday 10th of April 2020 06:42:58 PM
Old 04-10-2020
I've attached the results. None of the subtitles seemed to translate properly. At least with me. I made sure to get rid of the '\r' on each .srt file with your code.


All the above files worked with my new program with about 99.98% accuracy (998/1000 were fine). I'm going to guess that awk is messing things up in your program, but I'm not sure. French, like you said, is harder to translate, but it is essential to be able to use French as it comes up so often.

I will continue to test if as you update. If you need anymore information, please just ask.


***EDIT***


So frustrating. In my program, Google Translate really cannot be depended upon to give you back information exactly as you sent it:


Code:
 ((1)) I'd been living with Marianne almost 3 years ((2)) in an apartment belonging to her. ((3)) Things were fine between us, till she said one day: ((4)) Got a second? ((5)) Yes, why? ((6)) To tell you something, but it may be a bad time. ((7)) Go on, say it. What's wrong? ((8)) I'm pregnant. ((9)) You're pregnant... ((10)) That's great. ((11)) Is it a problem for you? ((12)) Abel... ((13)) I'm pregnant, but not from you. ((14)) What? ((15)) I'm not pregnant from you. ((16)) So... from who then? ((17)) Paul. ((18)) You had a thing with Paul? ((19)) Yes. ((20)) Since when? ((21)) A little over a year. ((22)) But Paul is someone... ((23)) so... ((24)) So what? ((25)) So different, so... ((26)) Different from who? ((27)) I don't know... you know Paul's family. ((28)) They know. ((29)) If you've seen his family, what does it mean? ((30)) It means we may have to get married. ((31)) It means a lot to his parents. ((32)) Yes, they're a bit conventional, but... ((33)) You haven't chosen a date? ((34)) It's been saved. ((35)) Paul wants you to come. ((36)) Unless it bothers you. It's up to you. ((37)) When is it? ((38)) The 26th. ((39)) Of this month? ((40)) We prefer to act quickly, because of... ((41)) You want me to pack my stuff? ((42)) You still have time, but before the 26th is best. ((43)) What's today? ((44)) The 16th. ((45)) I have to go. I'll be late. ((46)) Maybe it wasn't the right time to tell you. ((47)) I'm glad you're taking it well. ((48)) He thought you'd be angry. ((49)) I kept reassuring him. ((50)) Can he call you today? ((51))

Yields:


Code:
((1)) C'était comme si nous vivions ensemble. ((2)) Je me souviens, ((3)) un jour, il a laissé sa voiture déverrouillée. ((4)) J'ai même ... ((5)) Attends, qu'est-ce que je dis? ((6)) C'était avant. J'étais plus jeune. ((7)) Quoi qu'il en soit, j'ai ouvert la porte ... ((8)) et j'ai pris une photo de moi à l'intérieur, ((9)) comme si j'étais à côté de lui et qu'il conduisait. ((10)) Je m'imaginais aller à Venise. ((11)) Lors de notre lune de miel. ((12)) Ce jour-là, j'ai pensé: ((13)) 'Il m'a vu à coup sûr. ((14)) Nous sommes un couple. Nous sommes amoureux. Nous partons ensemble. ((15)) Le Il s'est enfui. Il ne m'avait pas vu. ((16)) Il était en retard au travail. ((17)) Ce jour-là, ((18)) sans argent pour un ticket de métro, ((19)) Je suis rentré à pied de la banlieue. ((20)) Je détestais Marianne de l'avoir pris de moi. ((21)) quand elle a choisi mon frère Paul. '((23)) Mais quand Marianne a quitté Abel, ((24)) il a bougé et je l'ai perdu de vue. ((25)) Pendant les cinq années suivantes, ((26)) je n'ai pas vu Abel. ( (27)) Bien sûr, j'ai eu quelques aventures, ((28)) mais aucune mérite d'être racontée. ((29)) Maintenant que j'y pense, tout ce temps, ((30)) je n'ai bien fait qu'une chose. ((31)) J'ai grandi. ((32)) Puis un jour, par hasard, j'ai vu Abel. ((33)) Je suis Eve, la sœur de Paul. ((34)) Bonjour, Eve. ((35 )) Vous avez grandi. ((36)) Merci. ((37)) - Ça va? - Je vais bien. ((38)) Et vous? N'avez-vous pas fait du théâtre? ((39)) Oui, mais je me suis arrêté au théâtre. ((40)) Je ' m dans l'immobilier maintenant. ((41)) Tu gèle. ((42)) Vos dents claquent. ((43)) Êtes-vous occupé maintenant? ((44)) Je suis en retard. Je dois y aller. ((45)) Je vais déposer ton écharpe. ((46)) Non, c'est un cadeau, d'accord? ((47)) Bonne journée, amoureux. ((48)) À bientôt ... ((49)) Au revoir, Eve. ((50)) Pas même un amant, ((51))

Where is ((22))? Gone. Google Translate ate it. If I decrease the number of chunks sent to Google then ((22)) comes back, but that is not a dependable solution. If I use single brackets around the numbers, several similar problems arise with the text.


*brain explodes*

Last edited by bedtime; 04-12-2020 at 03:35 PM..
This User Gave Thanks to bedtime For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Combining elements of different commands in history

What is the correct format for a single command that would combine portions of 2 different lines in the command history? I'm using a C shell. Here's a simplified command history to clarify: 4 rm file1 5 ls -ld file2 file3 file4 6 cat file 5 With the above history, what would be the... (5 Replies)
Discussion started by: Dbyte
5 Replies

2. UNIX for Dummies Questions & Answers

combining sed commands

I would like to change the lines: originalline1 originalline2 to: originalline1new originalline1newline originalline2new originalline2newline To do this, id like to combine the commands: sed 's/^/&new/g' file > newfile1 and sed '/^/ a\\ newline\\ \\ (2 Replies)
Discussion started by: Dave724001
2 Replies

3. UNIX for Dummies Questions & Answers

combining commands

Hello all, I am trying to list and count all the files of a particular type in any given directory. I can use the commands separately but when I combine them they do not give an output. The command for counting the files is ls -1 | wc -l and for listing all the file of particular type say... (2 Replies)
Discussion started by: BigTool4u2
2 Replies

4. UNIX for Advanced & Expert Users

Combining two commands.

Is there anyway to achieve "find /home -name "*.bashrc" 2>/dev/null" and "PS1="\n>"" in the same command? I just wanna add a line to the previous command to change the PS1 variable to ">". (1 Reply)
Discussion started by: raidkridley
1 Replies

5. Shell Programming and Scripting

Combining multiple commands

Hi Guys, I am looking to optimze these 5 SSH lines to a single SSH to get my machine to not hang! lol! cat hosts.lst | xargs -n1 -t -i echo 'home/util/timeout 6 0 ssh -q {} top -b > util/{}.top &' >> r_query_info cat hosts.lst | xargs -n1 -t -i echo 'home/util/timeout 6 0 ssh -q {} uname -r... (5 Replies)
Discussion started by: wick3dsunny
5 Replies

6. UNIX for Dummies Questions & Answers

Combining two commands that use sar.

hey can anyone tell me how can i combine these two commands so that it is executed only once, but gives me both the results. IDLE=`sar 30 6 | grep Average | awk '{print $1 $5}' ` sar 30 120 | awk '{print $1" "$5}' >> mailx -m -s "$MSG" xyz@abc.com. (5 Replies)
Discussion started by: Ankur Khatri
5 Replies

7. UNIX for Dummies Questions & Answers

Combining resukts of ls commands

Hi, I have a directory with some XML files in it. I can use wildcards to get the list of XMLs I want say I have following XMLs in same dir Employee1.xml Employee2.xml Employee3.xml and Salary1.xml Salary2.xml Salary3.xml apart from other .txt .dat files etc I want to write a unix... (7 Replies)
Discussion started by: dsrookie
7 Replies

8. UNIX for Dummies Questions & Answers

Help with combining the ls and 'file' commands

I have a directory of 3000 files without extensions (Solaris 5.10). I would like to iterate the file names through the 'file' command and output their mime types (most are pdf or jpg, but a very few might be psd or swf which show simply as 'data') So, I would like the output of the 'ls'... (2 Replies)
Discussion started by: pwallace
2 Replies

9. Shell Programming and Scripting

How to combining awk commands?

I can achieve two tasks with 2 different awk commands: 1) awk -F";;WORD" '{print $2}' file | sed '/^$/d' #to find surface_word 2) awk -F"bw:|gloss:" '// {print $2}' file | sed '/\//!d; s:/*+*: + :g; s:^+::; s: *+ *$::;' #to find segmentation of surface_word Number 1) finds surface_word... (7 Replies)
Discussion started by: Viernes
7 Replies

10. Shell Programming and Scripting

Combining 2 commands

Hello all, I need to send an attachment and text in the body, both in the same Email. Below are two cammand that send the required data in separate Emails. I need to combine them so that I get just 1 Email containing the attachment & text in the body. uuencode ${filename} "${file_}" |... (6 Replies)
Discussion started by: Junaid Subhani
6 Replies
All times are GMT -4. The time now is 03:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy