Sponsored Content
Top Forums Shell Programming and Scripting Regex within IF statement in awk Post 302806307 by Ophiuchus on Monday 13th of May 2013 12:31:59 AM
Old 05-13-2013
Hello hanson and alister,

Many thanks for your time to try to help. And thanks for your explanations, I have more clear some things.

hanson,

I was tried too, use double escaping but I had the semicolon in the same place either Smilie.

Alister,

May you explain me please, why that misplaces semicolon generates an empty if-statement.

When I need to put semicolon (when is mandatory and when is not)?

In this case, the semicolon was actually ruining the output.

Thanks for all the help.

Last edited by Ophiuchus; 05-13-2013 at 01:39 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Regex in if-then-else statement to match strings

hello I want to do a pattern match for string in the if statement, but I am not sure how to use regex inside the if statement. I am looking for something like this: if {2,3} ]; then ..... .... ... fi (7 Replies)
Discussion started by: rakeshou
7 Replies

2. Shell Programming and Scripting

awk or regex

Hi! I want to made a program that will generate code like this: {{Navedi XYZ |avtor=XYZ1 |naslov=XYZ2 |leto_izzida=XYZ3 |zalozba=XYZ4 |kraj=XYZ5 |isbn=XYZ6 |cobiss_id=XYZ7 }} from input like this: <b> ODGOVORNOST............. : <a... (5 Replies)
Discussion started by: smihael
5 Replies

3. Shell Programming and Scripting

[BASH] recognise new line regex in case statement

Hi, I'm trying to write a routine to parse a file that contains data that will be read into arrays. The file is composed of labels to identify data types and arbitrary lines of data with the usual remarks and empty new lines as is common with config files. The initial pass is built as so:... (3 Replies)
Discussion started by: ASGR
3 Replies

4. Shell Programming and Scripting

awk regex problem

hi everyone suppose my input file is ABC-12345 ABCD-12345 BCD-123456 i want to search the specific pattern which looks like - in a file so i used this command cat $file | awk ' { if ($0 ~ /-/) { print } }' so it gives me the result as ABCD-12345 BCD-12345 BCD-12345 ... (31 Replies)
Discussion started by: aishsimplesweet
31 Replies

5. UNIX for Dummies Questions & Answers

Using AWK and regex

Hi can you suggest in this regard The sample.txt conatins the data name lines type sam 12 txt sam 24 xls sam 36 pdf ram 32 txt ram 45 sxls ram 58 word sam 92 jpeg sam 21 gif sam 22 ltf from the data i need to sum all line... (5 Replies)
Discussion started by: krashraj
5 Replies

6. Shell Programming and Scripting

awk equivalent of regex

Hi all, Can someone tell me what's the (g)awk equal of this simple regex to find ip addresses in urls: egrep "^http://{1,3}\.{1,3}\.{1,3}\.{1,3}(:{1,5})?/"Input: http://10.0.0.1/query.exe http://11y10x09w:80/howaboutme http://192.168.100.190:1234/takeme.gpg Output:... (8 Replies)
Discussion started by: r4v3n
8 Replies

7. Shell Programming and Scripting

Regex escape special character in AWK if statement

I am having issues escaping special characters in my AWK script as follows: for id in `cat file` do grep $id in file2 | awk '\ BEGIN {var=""} \ { if ( /stringwith+'|'+'50'chars/ ) { echo "do this" } else if ( /anotherString/ ) { echo "do that" } else { ... (4 Replies)
Discussion started by: purebc
4 Replies

8. Shell Programming and Scripting

If statement with [[ ]] and regex not working as expected

Using BASH: $ if -- ::00" ]]; then echo "true"; else echo "false"; fi false Mike (5 Replies)
Discussion started by: Michael Stora
5 Replies

9. Shell Programming and Scripting

Perl - what does this statement mean -Regex

push @MACARRAY, "$+{catalog} $+{machine}\n" if ($info =~ /(?<catalog>catalog).+?(?<machine>\*+)/ms); I am (still) trying to solve problem. Looking around on the server I found this piece of code. Specifically what does "$+{catalog} $+{machine}\n" do ? Thanks in advance (1 Reply)
Discussion started by: popeye
1 Replies

10. Shell Programming and Scripting

Convert Update statement into Insert statement in UNIX using awk, sed....

Hi folks, I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex. I have a bunch of update statements with all columns in a file which I need to convert into insert statements. UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Discussion started by: dev123
0 Replies
OGGTRANSCODE(1) 						   User Manuals 						   OGGTRANSCODE(1)

NAME
oggTranscode - transcodes ogg files in multiple ways SYNOPSIS
oggTranscode [options] inputfile.ogv outputfile.ogv DESCRIPTION
oggTranscode can resize an ogg file (ogg, oga or ogv) in multiple ways: It can change the video frame size, change datarate for the video and/or audio streams contained in the ogg file and it can also change the video frame rate or audio sample rate. Additionally, since version 0.8 oggTranscode can add any ogg comment and png-pictures with an alpha channel can be rendered into the video at any time period before and after the resizing process. oggTranscode was previously called oggResize. OPTIONS
-s Sets the size of the video frame. The size is given as <width>x<height>. At default, the video frame size keeps the same. Example: -s 320x240 -d Sets the datarate in byte per seconds for the video encoder (theora). This meant to be a upper threshold. So the file may be smaller than assumed. If not set, the datarate of the original stream is used. Example: -d 1024000 -D Sets the datarate in byte per seconds for the audio encoder (vorbis). If not set, the datarate of the original stream is used. Example: -D 64000 -f Sets the frame rate of the video with numinator and demoninator and is the pictures per second. If only one number is given, the denominator is set to 1. If not set, the framerate of the original video is used. Example: -f 25:2 -F Sets the sample frequency (sample rate) of the audio data in Hertz. If the sample frequency does not match the one with the original file, resamling is invoked. Example: -F 32000 -c Adds comments to the video (theora) stream. Comments are given by a pair of type and value in the form 'type=value'. More than one comment can be concatenated with a semicolon. It is recommended to use apostrophes as the command line may use the semicolon as a seperator. Example: -c 'AUTHOR=yorn;DATE=03.07.09' -C Adds comments to the audio (vorbis) stream. Comments are given by a pair of type and value in the form 'type=value'. More than one comment can be concatenated with a semicolon. It is recommended to use apostrophes as the command line may use the semicolon as a seperator. Example: -C 'AUTHOR=yorn;DATE=03.07.09' -q Specifies the quality for the resizing process. Values can be chosen between 1 (best quality, with slight bluring) and 6 (worst quality). The default value is 2. Example: -q1 -p This option is meant to help creating a preview of a film. The number given with this option defines the number of frames, that are omitted. E.g. if a film has 24 frames per second and -p24 is given, the newly created video shows the video 24 times faster as only every 24th frame is used. This option can be combined with the option -f to control the framerate. With both options nice video previews can be created. If -p is used, the audio stream is ignored. Example: -p 24 -a Adds a picture to the video frame before it is resized. The expression for the picture appearances: <picture1.png>[,<startTime>[,<endTime>[,s]]] default startTime is 0 default endTime is -1, which is the end of the stream duration default s ist not set. If s is set, the picture slides in smoothly. More than one picture can be included. To concatenate the expressions use the colon. If the appearance time overlap, the pictures are placed on one another, so the last picture is the uppest layer. Example: -a etwas.png,2,7,s:etwasneues.png,5,10 -A Adds a picture to the video frame after it is resized. The syntax follows the same expression as with option -a. EXAMPLE
oggTranscode -s320x240 -d512000 orig.ogv new.ogv Converts a the video orig.ogv to the video new.ogv with the new frame size 320x240. If there was an audio stream within the orig.ogv file, it is copied into the new file. oggTranscode -D64000 -F16000 -N1 orig.ogv new.ogv Converts only the audio stream of file orig.ogv to a sample rate of 16kHz, a datarate of 64 kBit/s and a mono channel. The video stream is copied as is. oggTranscode -s300x200 -D32000 -d1024000 -A etwas.png,2,7,s:etwasneues.png,5,10 orig.ogv new.ogv Converts the audio and video stream and adds the alpha channel picture etwas.png to the video from second 2 to second 7 with a smooth fade in and fade out. Additionally the alpha channel picture etwasneues.png is placed on top of the video frame from second 5 to second 10 without any fading. AUTHOR
Joern Seger <yorn at gmx dot net> SEE ALSO
oggCut(1), oggCat(1), oggJoin(1), oggSplit(1), oggSlideshow(1), oggThumb(1), oggSilence(1) Linux JAN 2010 OGGTRANSCODE(1)
All times are GMT -4. The time now is 04:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy