Sponsored Content
Top Forums UNIX for Dummies Questions & Answers extracting only the filename without its extenstion Post 81846 by lotus123 on Wednesday 24th of August 2005 02:44:44 PM
Old 08-24-2005
extracting only the filename without its extenstion

Hi,

I have a requirement that i need to store only the filename without its extension. Can anyone please help me to do this.

For Example, i have stored the filename in a varialble called fname. I need to extract all the charecters before the first occurence of the dot.
If fname has value as PG_0008_20050519.xml.gz then i need to extract only "PG_0008_20050519". Please help me to do this.

TIA.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Extracting Filename from Fullpath

Hi, Any help on this would be very appreciated. I capture the full path & filename in a variable like (varFile=/home/user/extfile.txt). Now in my shell script I have to use only the filename part i.e. extfile.txt. How do I extract only the filename part from the variable? Thanks in... (3 Replies)
Discussion started by: njoshi
3 Replies

2. Shell Programming and Scripting

gzcat into awk and then change FILENAME and process new FILENAME

I am trying to write a script that prompts users for date and time, then process the gzip file into awk. During the ksh part of the script another file is created and needs to be processed with a different set of pattern matches then I need to combine the two in the end. I'm stuck at the part... (6 Replies)
Discussion started by: timj123
6 Replies

3. Shell Programming and Scripting

Extracting the Filename

Hi, I need to extract the file name without filetype. Suppose in DIR1 if i have files like F1.txt and F2.DOC then i need to return F1 and F2 only with out file types (txt and DOC). I tried with the following code newname = ` $i | cut -d "'." -f1` but it is giving the error " 0403-006... (1 Reply)
Discussion started by: Raamc
1 Replies

4. UNIX for Dummies Questions & Answers

extracting date from a filename

Hi, I am a beginner in Unix so please bear with me... I have a directory which has files in format: RECF-YYYY-MM-DD-input. For example, RECF-2008-02-25-input. I need to extract the YYYYY-MM-DD substring from this filename and convert that into date and compare it with a date. How do I do that?... (7 Replies)
Discussion started by: laiko
7 Replies

5. Shell Programming and Scripting

Filename from splitting files to have the same filename of the original file with counter value

Hi all, I have a list of xml file. I need to split the files to a different files when see the <ko> tag. The list of filename are B20090908.1100-20090908.1200_CDMA=1,NO=2,SITE=3.xml B20090908.1200-20090908.1300_CDMA=1,NO=2,SITE=3.xml B20090908.1300-20090908.1400_CDMA=1,NO=2,SITE=3.xml ... (3 Replies)
Discussion started by: natalie23
3 Replies

6. Shell Programming and Scripting

extracting multiple variables from a filename.

hi all, I'm trying to automate some tasks and while I've got the script itself working, I'm having difficulties with automatic file detection and associated variable setting... for example, in a directory I've got several files... something along the lines of: xis0_NAME_src.file... (2 Replies)
Discussion started by: u5j84
2 Replies

7. Shell Programming and Scripting

Extracting a portion of the filename

Hi I would like to extract the first portion of filename from a list of files. The filename pattern is of the form 123456789_TEXT_TEXT_TEXT_.csv. I want to extract just the numerical portion of this filename from the list of files and then output this into another text file. K (6 Replies)
Discussion started by: kamal_p_99
6 Replies

8. SuSE

Newbi: High availbilty extenstion for SLES 11 on VMware

Hi Guys , Can some one help me out with the basic requirements and steps required to setting up High availabilty extension in SLES11 sp2 on vmware .:) Iam struggling with the basic installation of SLES and finally completed it after a long trilas and it will be helpful if some one do help me... (0 Replies)
Discussion started by: shiek.kaleem
0 Replies

9. Shell Programming and Scripting

Print n lines from top and n lines from bottom of all files with .log extenstion

Oracle Linux 6.4 In a directory I have more than 300 files with the extension .log I want the first 5 and last 5 lines of these .log files to be printed on screen with each file's name. Expected output : Printing first 5 and last 5 lines of FX_WT_Feb8_2014.log !! Authentication... (7 Replies)
Discussion started by: kraljic
7 Replies

10. UNIX for Beginners Questions & Answers

Extracting filename

I am using bash and have a filename with a path and extension and want to extract just the filename Have used the following code, oflna gives the file name with extension, but now neet to remove the .texi at the end. oflna=${flnm##*/} oflnb=${${flnm##*/}%.*} echo "flnm: $flnm" echo... (1 Reply)
Discussion started by: Danette
1 Replies
g3data    (1) 				      General Commands Manual						     g3data    (1)

NAME
g3data -- A tool for extracting data from graphs. SYNOPSIS
g3data [-max x y] [-scale factor] [-coords llx lly rux ruy] [-errors] [-lnx] [-lny] [filename(s) ...] DESCRIPTION
2001-01-01; g3data is a tool for extracting data from scanned graphs. For graphs published in scientific articles the actual data is usually not explicitly given ; g3data makes the process of extracting this data easy. OPTIONS
-max x y If picture is larger x-wise than x or y-wise than y, the picture is scaled down accordingly otherwise this parameter has no effect. -scale factor Scales the picture size by factor. This parameter nullifies effect of the -max parameter. -coords llx lly rux ruy Preset the coordinates of the left lower (ll) corner and the right upper (ru) corner. -errors Print out the error of the x value in column 3 and the error of y value in column 4 of the output. -lnx Use logarithmic scale for x coordinates. -lny Use logarithmic scale for y coordinates. filename(s) ... The filename(s) of the image(s) to open. Supported image formats: PNG, XPM, JPEG, TIFF, PNM, RAS, BMP and GIF. USAGE
g3data -scale 2 -errors test1.png g3data -scale 2 -lny -errors test2.png BUGS
None known. AUTHOR
Jonas Frantz jonas.frantz@welho.com g3data (1)
All times are GMT -4. The time now is 05:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy