Sponsored Content
Top Forums Shell Programming and Scripting How to print the output side by side? Post 303022678 by baris35 on Wednesday 5th of September 2018 09:28:02 AM
Old 09-05-2018
How to print the output side by side?

Hello,
I know it is too simple but I do not know..
:/

Code:
#!/bin/bash
for file in *.mp4
do
echo "$file"
ffmpeg -i $file 2>&1 | grep Duration |cut -d ' ' -f 4 | sed s/,//
done

Expected Output:
Code:
NF_-_Let_You_Down-fbHbTBP_u7U.mp4	00:03:35.74
NF_-_WHY-zuJV-DAv_wE.mp4	00:03:11.87
Nicki_Minaj_-_Chun-Li-Wpm07-BGJnE.mp4	00:05:09.41
Nicki_Minaj_-_Chun-Li_Vertical_Video-SCq8n_hOcN8.mp4	00:03:21.67
Post_Malone_-_Psycho_ft._Ty_Dolla_ign-au2n7VVGv_c.mp4	00:03:56.64


It gives:
Code:
NF_-_Let_You_Down-fbHbTBP_u7U.mp4
00:03:35.74
NF_-_WHY-zuJV-DAv_wE.mp4
00:03:11.87
Nicki_Minaj_-_Chun-Li-Wpm07-BGJnE.mp4
00:05:09.41
Nicki_Minaj_-_Chun-Li_Vertical_Video-SCq8n_hOcN8.mp4
00:03:21.67
Post_Malone_-_Psycho_ft._Ty_Dolla_ign-au2n7VVGv_c.mp4
00:03:56.64

I'd like to do it without transposition or convertion row to column etc.


Many thanks
Boris
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to print two sql query outputs side by side in excel

Hi, I have to sql queries like select sno,sname from temptable; select deptno,dname from depttable; In excel i want to specify the column number to which my output should be displayed. please help me in this... thanks in advance... (6 Replies)
Discussion started by: prasee
6 Replies

2. Shell Programming and Scripting

Script to place selected columns from a group of files side by side in a new file

Hi Everyone, I need a shell/perl script to bring selected columns from all the files located in a directory and place them in a new file side by side. File1: a b c d 2 3 4 5 f g h i .......... File2: I II III IV w x y z .............. and so on many files are there...... (8 Replies)
Discussion started by: ks_reddy
8 Replies

3. Shell Programming and Scripting

How to Merge / combine / join / paste 2 text files side-by-side

I have 2 text files, both have one simple, single column. The 2 files might be the same length, or might not, and if not, it's unknown which one would be longer. For this example, file1 is longer: ---file1 Joe Bob Mary Sally Fred Elmer David ---file2 Tomato House Car... (3 Replies)
Discussion started by: cajunfries
3 Replies

4. Web Development

Cannot access Apache web server from Wan side, only Lan side.

I have installed WAMPSERVER 2.0 on my windows vista x64 system but still am having issues with getting the webserver to be seen outside my local network. It is working fine within my local network. Been through several setup tutorials so far, no dice still. For testing purposes I have... (1 Reply)
Discussion started by: davidmanvell
1 Replies

5. Shell Programming and Scripting

Paste two file side by side together based on specific pattern match problem

Input file_1: P78811 P40108 O17861 Q6NTW1 P40986 Q6PBK1 P38264 Q6PBK1 Q9CZ49 Q1GZI0 Input file_2: (6 Replies)
Discussion started by: patrick87
6 Replies

6. Shell Programming and Scripting

printing 3 files side by side based on similar values in rows

Hi I'm trying to compare 3 or more files based on similar values and outputting them into 3 columns. For example: file1 ABC DEF GHI file2 DEF DER file3 ABC DER The output should come out like this file1 file2 file3 ABC ABC (4 Replies)
Discussion started by: zerofire123
4 Replies

7. Shell Programming and Scripting

How to print contents side by side of a file ?

Hi Team, I have input like Input file.txt Contents: Total: 939720704 bytes Total: 521142272 bytes Total: 262144 bytes Total: 786432 bytes Total: 9043968 bytes Total: 9371648 bytes I need out put like the content of file should be side by side.that is 1st line beside... (3 Replies)
Discussion started by: rocking77
3 Replies

8. Shell Programming and Scripting

Output variable side by side

how do you display variable that contain multi line side by side dynamically without knowing the number of variable and line for each variable ? Example echo $a a b c echo $b 1 2 3 echo $c q w e how to output the result in (3 Replies)
Discussion started by: pikamon
3 Replies

9. Shell Programming and Scripting

Print side by side

Dear all, How can I print any variable or string value side by side for each line within a loop? For example I have 300 zeros and I want to get an output like below lines. Each line have to be truncated at the end of the lines ( eg. 80 characters). 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0... (4 Replies)
Discussion started by: bulpak
4 Replies

10. Shell Programming and Scripting

How to run 2 python scripts at the same time side by side on the same line?

Could I run 2 python scripts at the same time side by side output on the same line in this same format but with scripts? from itertools import izip_longest with open("file1") as textfile1, open("file2") as textfile2: for x, y in izip_longest(textfile1, textfile2, fillvalue=""): x =... (4 Replies)
Discussion started by: bigvito19
4 Replies
Info(3pm)						User Contributed Perl Documentation						 Info(3pm)

NAME
MP4::Info - Fetch info from MPEG-4 files (.mp4, .m4a, .m4p, .3gp) SYNOPSIS
#!perl -w use MP4::Info; my $file = 'Pearls_Before_Swine.m4a'; my $tag = get_mp4tag($file) or die "No TAG info"; printf "$file is a %s track ", $tag->{GENRE}; my $info = get_mp4info($file); printf "$file length is %d:%d ", $info->{MM}, $info->{SS}; my $mp4 = new MP4::Info $file; printf "$file length is %s, title is %s ", $mp4->time, $mp4->title; DESCRIPTION
The MP4::Info module can be used to extract tag and meta information from MPEG-4 audio (AAC) and video files. It is designed as a drop-in replacement for MP3::Info. Note that this module does not allow you to update the information in MPEG-4 files. $mp4 = MP4::Info->new(FILE) OOP interface to the rest of the module. The same keys available via "get_mp4info" and "get_mp4tag" are available via the returned object (using upper case or lower case; but note that all-caps 'VERSION' will return the module version, not the MPEG-4 version). Passing a value to one of the methods will not set the value for that tag in the MPEG-4 file. use_mp4_utf8([STATUS]) Tells MP4::Info whether to assume that ambiguously encoded TAG info is UTF-8 or Latin-1. 1 is UTF-8, 0 is Latin-1. Default is UTF-8. Function returns new status (1/0). If no argument is supplied, or an unaccepted argument is supplied, function merely returns existing status. This function is not exported by default, but may be exported with the ":utf8" or ":all" export tag. get_mp4tag (FILE) Returns hash reference containing the tag information from the MP4 file. The following keys may be defined: ALB Album APID Apple Store ID ART Artist CMT Comment COVR Album art (typically JPEG or PNG data) CPIL Compilation (boolean) CPRT Copyright statement DAY Year DISK Disk number & total (2 integers) GNRE Genre GRP Grouping NAM Title RTNG Rating (integer) TMPO Tempo (integer) TOO Encoder TRKN Track number & total (2 integers) WRT Author or composer For compatibility with MP3::Info, the MP3 ID3v1-style keys TITLE, ARTIST, ALBUM, YEAR, COMMENT, GENRE and TRACKNUM are defined as synonyms for NAM, ART, ALB, DAY, CMT, GNRE and TRKN[0]. Any and all of these keys may be undefined if the corresponding information is missing from the MPEG-4 file. On error, returns nothing and sets $@. get_mp4info (FILE) Returns hash reference containing file information from the MPEG-4 file. The following keys may be defined: VERSION MPEG version (=4) LAYER MPEG layer description (=1 for compatibility with MP3::Info) BITRATE bitrate in kbps (average for VBR files) FREQUENCY frequency in kHz SIZE bytes in audio stream SECS total seconds, rounded to nearest second MM minutes SS leftover seconds MS leftover milliseconds, rounded to nearest millisecond TIME time in MM:SS, rounded to nearest second COPYRIGHT boolean for audio is copyrighted ENCODING audio codec name. Possible values include: 'mp4a' - AAC, aacPlus 'alac' - Apple lossless 'drms' - Apple encrypted AAC 'samr' - 3GPP narrow-band AMR 'sawb' - 3GPP wide-band AMR 'enca' - Unspecified encrypted audio ENCRYPTED boolean for audio data is encrypted Any and all of these keys may be undefined if the corresponding information is missing from the MPEG-4 file. On error, returns nothing and sets $@. BUGS
Doesn't support writing tag information to MPEG-4 files. If you find a bug, please send me a patch. If you cannot figure out why it does not work for you, please put the MP4 file in a place where I can get it (preferably via FTP, or HTTP) and send me mail regarding where I can get the file, with a detailed description of the problem. I will keep a copy of the file only for as long as necessary to debug the problem. AUTHOR
Jonathan Harris <jhar@cpan.org>. THANKS
Chris Nandor <pudge@pobox.com> for writing MP3::Info Dan Sully at Slim Devices for cover art and iTunes/aacgain metadata patches. Ruben Laguna for PSP support. SEE ALSO
MP4::Info Project Page <http://search.cpan.org/~jhar/MP4-Info> ISO 14496-12:2004 - Coding of audio-visual objects - Part 12: ISO base media file format <http://www.iso.ch/iso/en/ittf/PubliclyAvailableStandards/c038539_ISO_IEC_14496-12_2004(E).zip> ISO 14496-14:2003 - Coding of audio-visual objects - Part 14: MP4 file format <http://www.iso.org/iso/en/CatalogueDetailPage.CatalogueDetail?CSNUMBER=38538> (Not worth buying - the interesting stuff is in Part 12). 3GPP TS 26.244 - 3GPP file format(3GP) <http://www.3gpp.org/ftp/Specs/html-info/26244.htm> QuickTime File Format <http://developer.apple.com/documentation/QuickTime/QTFF/> ISO 14496-1 Media Format <http://www.geocities.com/xhelmboyx/quicktime/formats/mp4-layout.txt> MP3::Info <http://search.cpan.org/~cnandor/MP3-Info/> COPYRIGHT and LICENSE Copyright (c) 2004-2010, Jonathan Harris <jhar@cpan.org> This program is free software; you can redistribute it and/or modify it under the the same terms as Perl itself. perl v5.10.1 2010-07-30 Info(3pm)
All times are GMT -4. The time now is 04:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy