Sponsored Content
Top Forums Shell Programming and Scripting Counting total files with different file types in each folder Post 302999731 by kchinnam on Tuesday 27th of June 2017 08:03:49 AM
Old 06-27-2017
I ran it on a small sample data in one folder,, its working great.. Not sure why its getting "." at the end!?

Code:
299     ERROR   .
299     RUNTM   .
299     OTHER   .

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

grep running total/ final total across multiple files

Ok, another fun hiccup in my UNIX learning curve. I am trying to count the number of occurrences of an IP address across multiple files named example.hits. I can extract the number of occurrences from the files individually but when you use grep -c with multiple files you get the output similar to... (5 Replies)
Discussion started by: MrAd
5 Replies

2. Shell Programming and Scripting

list quantity of files by file types

I'm trying to create a simple file inventory for a series of huge directories containing e-records. What I'm after is a list of all directories and sub-directories with just the number of each type of file in that directory/sub-directory. For example output would look like: ... (6 Replies)
Discussion started by: dorcas
6 Replies

3. Shell Programming and Scripting

check how many files in folder or total files in folder

Hi all, I have copied all my files to one folder.and i want to check how many files (count) in the folder recently moved or total files in my folder? please send me the query asap. (3 Replies)
Discussion started by: durgaprasad
3 Replies

4. Shell Programming and Scripting

Getting the total file size for certain files per directory

Hi, I am trying to get the total file size for certain files per directory. I am using find /DirectoryPath -name '*.dta' -exec ls -l {} \; | awk '{ print $NF ": " $5 }' > /users/cergun/My\ Documents/dtafiles.txt but this lists all the files in the directories. I need the total... (9 Replies)
Discussion started by: cergun
9 Replies

5. UNIX for Dummies Questions & Answers

Counting total users

wow, back again :) I am trying to write a program that has many functions, however one of the functions will count the total number of users in the database. I want to just use wc -l passwd (i've made a copy of passwd to play with, no worries lol) but I am worried that if any of the... (4 Replies)
Discussion started by: SoVi3t
4 Replies

6. UNIX for Dummies Questions & Answers

I am trying to get the total size of a folder?

I am trying to get the total size of the folder using the below command but its not working. any ideas? du -bc <foldername>/|grep total|tr -s " "|cut -d" " -f1 the output i am getting is 78996 total but i just want it to be as 78996 please help (3 Replies)
Discussion started by: classic
3 Replies

7. Shell Programming and Scripting

Counting number of files that contain words stored in another file

Hi All, I have written a script on this but it does not do the requisite job. My requirement is this: 1. I have two kinds of files each with different extensions. One set of files are *.dat (6000 unique DAT files all in one directory) and another set *.dic files (6000 unique DIC files in... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

8. UNIX for Dummies Questions & Answers

[Solved] Touch 10% of the total files inside a folder

I'm trying to make this code below to work but I can't find the way to do the following: I want to make the script to touch only 10% of the total amount of files counted inside the given directory instead of all like it is now. I would greatly appreciate it if someone can give me a direction on... (9 Replies)
Discussion started by: regraphix
9 Replies

9. Shell Programming and Scripting

Total number of files in the folder should be listed

Hi All, When i give the ls -lrt to list out all files with total number of files , i get the output as ls -lrt total 72 -rw-r--r-- 1 hari staff 796 Jul 11 09:17 va.txt -rw-r--r-- 1 hari staff 169 Jul 13 00:20 a.log -rwxr-xr-x 1 hari staff 659 Aug... (9 Replies)
Discussion started by: Kalaihari
9 Replies

10. UNIX for Advanced & Expert Users

Searching for file types by count in specific folder in RHEL 6

So I'm trying to search for the top 10 or 15 items under a directory by file type. I want to run a command on a directory and get something like the following: Example of expected output.. .PDF: 100, .txt: 95, .word: 80.. What would be the best way of going about this? I've searched around... (2 Replies)
Discussion started by: shackle101
2 Replies
IMAGEFTBBOX(3)								 1							    IMAGEFTBBOX(3)

imageftbbox - Give the bounding box of a text using fonts via freetype2

SYNOPSIS
array imageftbbox (float $size, float $angle, string $fontfile, string $text, [array $extrainfo]) DESCRIPTION
This function calculates and returns the bounding box in pixels for a FreeType text. PARAMETERS
o $size -The font size. Depending on your version of GD, this should be specified as the pixel size (GD1) or point size (GD2). o $angle - Angle in degrees in which $text will be measured. o $fontfile - The name of the TrueType font file (can be a URL). Depending on which version of the GD library that PHP is using, it may attempt to search for files that do not begin with a leading '/' by appending '.ttf' to the filename and searching along a library-defined font path. o $text - The string to be measured. o $extrainfo - Possible array indexes for $extrainfo +------------+-----------------------------+ | Key | | | | | | | Type | | | | | | Meaning | | | | +------------+-----------------------------+ | | | |linespacing | | | | | | | | | | float | | | | | | Defines drawing linespacing | | | | +------------+-----------------------------+ RETURN VALUES
imageftbbox(3) returns an array with 8 elements representing four points making the bounding box of the text: +--+--------------------------------+ |0 | | | | | | | lower left corner, X position | | | | |1 | | | | | | | lower left corner, Y position | | | | |2 | | | | | | | lower right corner, X position | | | | |3 | | | | | | | lower right corner, Y position | | | | |4 | | | | | | | upper right corner, X position | | | | |5 | | | | | | | upper right corner, Y position | | | | |6 | | | | | | | upper left corner, X position | | | | |7 | | | | | | | upper left corner, Y position | | | | +--+--------------------------------+ The points are relative to the text regardless of the $angle, so "upper left" means in the top left-hand corner seeing the text horizon- tally. EXAMPLES
Example #1 imageftbbox(3) example <?php // Create a 300x150 image $im = imagecreatetruecolor(300, 150); $black = imagecolorallocate($im, 0, 0, 0); $white = imagecolorallocate($im, 255, 255, 255); // Set the background to be white imagefilledrectangle($im, 0, 0, 299, 299, $white); // Path to our font file $font = './arial.ttf'; // First we create our bounding box $bbox = imageftbbox(10, 0, $font, 'The PHP Documentation Group'); // This is our cordinates for X and Y $x = $bbox[0] + (imagesx($im) / 2) - ($bbox[4] / 2) - 5; $y = $bbox[1] + (imagesy($im) / 2) - ($bbox[5] / 2) - 5; imagefttext($im, 10, 0, $x, $y, $black, $font, 'The PHP Documentation Group'); // Output to browser header('Content-Type: image/png'); imagepng($im); imagedestroy($im); ?> NOTES
Note This function requires GD 2.0.1 or later (2.0.28 or later is recommended). Note This function is only available if PHP is compiled with freetype support ( --with-freetype-dir=DIR) PHP Documentation Group IMAGEFTBBOX(3)
All times are GMT -4. The time now is 04:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy