01-16-2008
Assuming that you have a line in variable X:
X="${X##*/}"
X="${X%.pls}"
To extract lines you can use "while read". Probably "while read -p".
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I have an input file which looks like
"
@$SCRIPT/atp_asrmt_adj.sql
$SCRIPT/dba2000.scr -s / @$SCRIPT/cim1005w.pls
$SCRIPT/dba2000.scr -s / @$SCRIPT/cim1006w.pls
start $SCRIPT/cim1020d.sql;^M
spool $DATA/cim1021m.sql
@$DATA/cim1021m.sql
! rm $DATA/cim1021m.sql
spool $DATA/cim1021m.sql... (6 Replies)
Discussion started by: dowsed4u8
6 Replies
2. Shell Programming and Scripting
Hello,
I have data in a file something like this -
UNB+UNOA:1+006415160:1+AR0000012360:ZZ+080701:0552+2++DELFOR++++T'UNH+2+DELFOR:D:97A:UN
Here, the delimiters used are + , : and ' . I have a set of such files in which these delimiters vary from one file to another.
I am developing a... (4 Replies)
Discussion started by: The Observer
4 Replies
3. Shell Programming and Scripting
Hi,
Please help me to extrat values b/w two delimiters.
$ echo $abc
i want to extract the value 12345 b/w %. (5 Replies)
Discussion started by: tsaravanan
5 Replies
4. Programming
needa c program to extract text between two delimiters from some text file.
and then storing them in to diffrent variables ?
text file like 0:
abc.txt
=========
aaaaaa|11111111|sssssssssss|333333|ddddddddd|34343454564|asass
aaaaaa|11111111|sssssssssss|333333|ddddddddd|34343454564|asass... (7 Replies)
Discussion started by: kukretiabhi13
7 Replies
5. Shell Programming and Scripting
I need to extract certain pieces from a string, wher delimiters may vary. For example
A0 B0 C0 12345677 X0 Y0 Z0
A1-B1 C1 12345678 X1 Y0 Z0
A1/B2 C77 12345679 X2 Y0 Z0
I need to get
C0 12345677 X0
C1 12345678 X1
C77 12345679 X2
I tried sed, see example below:
echo 'A0 B0... (2 Replies)
Discussion started by: migurus
2 Replies
6. Shell Programming and Scripting
I'm trying to do a split using two delimiters. The first delimiter is ": " (or we could call it :\s). The second is "\n".
How can or these delimiters so I can toss the values into an array without issue?
I tried @array = split /:\s|\n/, $myvar;
This doesn't seem to be working.
Any an... (3 Replies)
Discussion started by: mrwatkin
3 Replies
7. Shell Programming and Scripting
Good afternoon!
I have an XML file from which I want to extract only certain elements contained within each line. The problem is that the format of each line is not exactly the same (though similiar). For example, oa_var will be in each line, however, there may be no value or other... (3 Replies)
Discussion started by: bab@faa
3 Replies
8. UNIX for Dummies Questions & Answers
Can you point me to information on the different delimited in UNIX like colon, spaces and tabs? (1 Reply)
Discussion started by: momhef4
1 Replies
9. Shell Programming and Scripting
Hi All,
i have file name like below
ABC_065224_123456_123456_your_130413_163005.txt
ABC_065224_123456_MAIN_20130413_163005.txt
ABC_065224_123456_123456_MAIN_130413_163005.txt
ABC_065224_123456_123456_434567_MAIN_130413_163005.txt
i need to find out the number of characters in the filed... (6 Replies)
Discussion started by: dssyadav
6 Replies
10. Shell Programming and Scripting
Hi All,
I'm stuck-up in finding a way to skip the delimiter which come within double quotes using awk or any other better option. can someone please help me out.
Below are the details:
Delimited: |
Sample data: 742433154|"SYN|THESIS MED CHEM PTY.... (2 Replies)
Discussion started by: BrahmaNaiduA
2 Replies
LEARN ABOUT NETBSD
icecream
ICECREAM(1) icecream ICECREAM(1)
NAME
icecream - download icecast and shoutcast streams, redirecting all fetched content to stdout and/or to disk at the same time
SYNOPSIS
icecream [OPTIONS] URL [URL..]
DESCRIPTION
icecream is a lightweight, non-interactive, stream download utility. It connects to icecast and shoutcast servers or direct stream URLs,
and redirects all fetched content to stdout and/or to media files on your disk.
Listen to the stream piping the output to a stdin-capable media player. Save the stream to a named file or split it into different tracks.
It is possible to redirect the stream and save it to disk at the same time.
icecream is able to parse pls and m3u playlists, and to download mp3 and ogg direct stream URLs. If the stream is anonymous it will be
saved as 'stream-time.mp3', where time is actual timestamp.
OPTIONS
-h, --help
Print a help message describing all options
-q, --quiet
Turn off output
-v, --verbose
Be verbose
-t, --tracks
Split stream into tracks (if possible)
--name=NAME
Save the stream to file specified by NAME. Format codes starting with "%" will be replaced. See the date command for valid format
codes.
--stop=N[units]
Stop downloading the stream after N kb/mb/min/songs
--user-agent=AGENT
Set user-agent header to AGENT
--stdout
Output stream to stdout (implies -q)
--sync Turn syncing on, required for some mpeg players that read from stdin
--debug Turn on debugging outputs
EXAMPLES
Streaming to mpg123
icecream --stdout http://radio.com/playlist.pls | mpg123 -
Split stream into different tracks
icecream -t http://metal.org/radio.pls
Split stream into tracks and play with vlc at the same time
icecream -t --stdout http://streaming.com/playlist.pls | vlc file:/dev/stdin
Prepare a 74 minute CD
icecream -t --stop 74min http://trace.net/playlist.m3u
Use a filename with today's date as output
icecream -q --name 'radio_%Y_%m_%d' --stop 60min http://radio.com/playlist.pls
BUGS
You are welcome to send bug reports about icecream to our mailing list. Feel free to visit http://icecream.sourceforge.net
AUTHOR
Written by Gil Megidish <gil at megidish.net>
1.3 2008-04-28 ICECREAM(1)