Sponsored Content
Top Forums Shell Programming and Scripting extract string portion from filename using sed Post 302318804 by santam on Friday 22nd of May 2009 09:27:46 AM
Old 05-22-2009
realised I have to use substitute but but still no joy :-(

sed 's/^.*[a-zA-Z]*[.][0-9][0-9]$//'`
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to extract a portion of a string from the whole string

How to extract a portion of a string from a full string using unix. For example: Say source string is = "req92374923.log" I want only the numeric portion of the string say "92374923" how to do that in Unix. (2 Replies)
Discussion started by: ds_sastry
2 Replies

2. Shell Programming and Scripting

need help on sed (replace string without changing filename)

I have awhole bunch of files and I want to edit stringA with stringB without changing the filename. I have tried the following sed commands: sed "s/stringA/stringB/g" * This will print the correct results but does not actually save it with the new content of the file. when I do a cat on... (5 Replies)
Discussion started by: jjoves
5 Replies

3. Shell Programming and Scripting

Match portion of the filename

hi, I have a script which accept filename and process them, however, one of the file needs 'special' handling so I need to identify it, say the filename contains the word "STOCK" (i.e. NEWYORKSTOCKLIST20060627.txt), I want to check if the filename contains the word "STOCK", how can I do that?... (1 Reply)
Discussion started by: mpang_
1 Replies

4. Shell Programming and Scripting

extract string portion using sed

Hi All I have 3 files as listed below and highlighted in bold the portions of the filenames I need to extract: TOS_TABIN218_20090323.200903231830 TOS_TABIN219_1_20090323.200903231830 TOS_TABIN219_2_20090323.200903231830 I tried source_tabin_name=`echo $fname | sed 's/_.*//'` but I... (6 Replies)
Discussion started by: santam
6 Replies

5. Shell Programming and Scripting

How to extract portion of a string?

Hi Gurus, Would like to seek some help on how to extract a portion of string from log's output as shown below. Sample of raw data: piece handle=/test123/disk_dump/test123/df0_cntrl_PCPFCI20120404_68498 tag=TAG20120404T180035 comment=NONE piece... (13 Replies)
Discussion started by: superHonda123
13 Replies

6. Shell Programming and Scripting

extract every filename containing certain string in a directory and do some commend per file

Hi, Here is my question: suppose I have files like 1990_8xdaily_atmos.nc 1991_8xdaily_atmos.nc 1992_8xdaily_atmos.nc 1993_8xdaily_atmos.nc 1990_daily_atmos.nc 1991_daily_atmos.nc 1992_daily_atmos.nc 1993_daily_atmos.nc 1990_month_atmos.nc 1991_month_atmos.nc 1992_month_atmos.nc... (1 Reply)
Discussion started by: 1988PF
1 Replies

7. Shell Programming and Scripting

Extract string from filename

Hi I need to extract the string from file name filename: FILENAME_STRUT_01032013_XXXXXXX.TXT I want 01032013 from the above file name. number of characters may differ before the required string but underscores(-) are same number i.e. after second underscore. Please advise on this. ... (2 Replies)
Discussion started by: cnrj
2 Replies

8. 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

9. Shell Programming and Scripting

Extract filename from a given string

I want to extract the filename from a string. This is how I have the rawdata ina file /home/sid/ftp/testing/abc.txt /home/sid/ftp/tested/testing/def.txt /home/sid/sftp/date/misc/hij.txt i want a script which would provide me an output like this Directory ... (10 Replies)
Discussion started by: sidnow
10 Replies

10. UNIX for Beginners Questions & Answers

Extract a portion of string from each line in Linux

Hi I have to extract the destination path information from each record the file is of variable length so I will not be able to use the print command.The search should start on variable "destinationPath" and it should end at immediate "," also the first field has to be printed Input File:... (7 Replies)
Discussion started by: rkakitapalli
7 Replies
JOY(4)							   BSD Kernel Interfaces Manual 						    JOY(4)

NAME
joy -- joystick device driver SYNOPSIS
To compile this driver into the kernel, place the following lines in your kernel configuration file: device joy Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5): joy_load="YES" In /boot/device.hints: hint.joy.0.at="isa" hint.joy.0.port="0x201" hint.joy.1.at="isa" hint.joy.1.port="0x201" #include <sys/joystick.h> DESCRIPTION
The joystick device driver allows applications to read the status of the PC joystick. This device may be opened by only one process at a time. The joystick status is read from a structure via a read() call. The structure is defined in the header file as follows: struct joystick { int x; /* x position */ int y; /* y position */ int b1; /* button 1 status */ int b2; /* button 2 status */ }; Positions are typically in the range 0-2000. One line perl example: perl -e 'open(JOY,"/dev/joy0")||die;while(1) {sysread(JOY,$x,16);@j=unpack("iiii",$x);print "@j ";sleep(1);}' ioctl calls Several ioctl() calls are also available. They take an argument of type int * JOY_SETTIMEOUT int *limit Set the time limit (in microseconds) for reading the joystick status. Setting a value too small may prevent to get correct values for the positions (which are then set to -2147483648), however this can be useful if one is only interested by the buttons status. JOY_GETTIMEOUT int *limit Get the time limit (in microseconds) used for reading the joystick status. JOY_SET_X_OFFSET int *offset Set the value to be added to the X position when reading the joystick status. JOY_SET_Y_OFFSET int *offset Set the value to be added to the Y position when reading the joystick status. JOY_GET_X_OFFSET int *offset Get the value which is added to the X position when reading the joystick status. JOY_GET_Y_OFFSET int *offset Get the value which is added to the Y position when reading the joystick status. TECHNICAL SPECIFICATIONS
The pinout of the DB-15 connector is as follow: 1 XY1 (+5v) 2 Switch 1 3 X1 (potentiometer #1) 4 Switch 1 (GND) 5 Switch 2 (GND) 6 Y1 (potentiometer #2) 7 Switch 2 8 N.C. 9 XY2 (+5v) 10 Switch 4 11 X2 (potentiometer #3) 12 Switch 3&4 (GND) 13 Y2 (potentiometer #4) 14 Switch 3 15 N.C. Pots are normally 0-150k variable resistors (0-100k sometimes), and according to the IBM technical reference, the time is given by Time = 24.2e-6s + 0.011e-6s * R/Ohms FILES
/dev/joy? joystick device files HISTORY
The joy driver appeared in FreeBSD 2.0.5. AUTHORS
Jean-Marc Zucconi <jmz@cabri.obs-besancon.fr> BSD
January 23, 1995 BSD
All times are GMT -4. The time now is 08:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy