Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Obtain CSV Fiile from text

by hazylife (Monk)
on Mar 06, 2014 at 13:36 UTC ( [id://1077229]=note: print w/replies, xml ) Need Help??


in reply to Obtain CSV Fiile from text

How's this: echo "$your_line" | perl -nle 'print if s/.*?\s(\S+\.csv).*/$1/i'

EDIT: or, even better: perl -nle 'print if s#[^/]+(/\S+?\.csv).*#$1#i'

Replies are listed 'Best First'.
Re^2: Obtain CSV Fiile from text
by sherbertpunt (Initiate) on Mar 07, 2014 at 13:20 UTC

    Apologies to all I have been off for a couple of days, but thanks to all who came to my aid... in the end I went with..

    file=`echo $line | perl -n -l -e ' ($f) = $_ =~ m!.*/(\w+.csv)!i; print $f'

    I think my shell collegues were wary of this kind of magic :-) once again my thanks to you all

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1077229]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (1)
As of 2024-04-25 04:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found