Re: extract string from filename

2006-01-13 Thread Ted Roche
On Jan 12, 2006, at 8:25 PM, Ben Scott wrote: It sounds like you could use a tutorial on Unix text processing and command line tools, specifically, one which addresses pipes and redirection, as well as the standard text tools (grep, cut, sed, awk, etc.). While Paul's recommendation about the

Re: extract string from filename

2006-01-13 Thread Tom Buskey
On 1/12/06, Ben Scott [EMAIL PROTECTED] wrote: On 1/12/06, Zhao Peng [EMAIL PROTECTED] wrote: I'm back, with another extract string question. //grinIt sounds like you could use a tutorial on Unix text processing and command line tools, specifically, one which addresses pipes andredirection, as

How to find rpms for various distros?

2006-01-13 Thread Donald Leslie {74279}
I am running Suse and use apt-get for rpm or Yast with the Suse repositories. I was asked for a xdiif/mgdiff for rel4 . I looked at www.rpmfind.net and found rpms for Suse 9.3 and PLD nothing foir RedHat . I then tried www.fedoratracker.org . This is even worse it finds nothing for mgdiff.

Re: How to find rpms for various distros?

2006-01-13 Thread Ben Scott
On 1/13/06, Donald Leslie {74279} [EMAIL PROTECTED] wrote: Where should one look for the latest stuff for red hat I'm not much familar with SuSE, but for Red Hat and Fedora, an outstanding resource is the Dag Wiers / RPMforge repository. See http://dag.wieers.com/home-made/apt/ and

Re: extract string from filename

2006-01-13 Thread Bill McGonigle
On Jan 12, 2006, at 19:40, Zhao Peng wrote: I also downloaded an e-book called Learning Perl (OReilly, 4th.Edition), and had a quick look thru its Contents of Table, but did not find any chapter which looks likely addressing any issue related to my question. Good start. Read these

Re: How to find rpms for various distros?

2006-01-13 Thread Bill McGonigle
On Jan 13, 2006, at 10:26, Ben Scott wrote: Once I added the dag repository to my YUM configuration, I find I can usually find any given package by doing yum install foo or yum search foo. I'll second Ben's recommendation of Dag, and add try yumex if you're in the mood for a stroll; -Bill

Re: BSD User's group?

2006-01-13 Thread Bill McGonigle
On Jan 12, 2006, at 17:27, Martin Ekendahl wrote: Too much eye candy or something, I can't put my finger on it. I like my console! init 3 will take care of that problem for you. also rpm --erase rhgb to get rid of that stupid graphical boot screen (which doesn't work on some

Re: How to find rpms for various distros?

2006-01-13 Thread Ben Scott
On 1/13/06, Bill McGonigle [EMAIL PROTECTED] wrote: I'll second Ben's recommendation of Dag, and add try yumex if you're in the mood for a stroll; Huh? What does try yumex do? -- Ben ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org

Re: How to find rpms for various distros?

2006-01-13 Thread Python
On Fri, 2006-01-13 at 10:52 -0500, Ben Scott wrote: On 1/13/06, Bill McGonigle [EMAIL PROTECTED] wrote: I'll second Ben's recommendation of Dag, and add try yumex if you're in the mood for a stroll; Huh? What does try yumex do? yumex provides a GUI layer on top of yum. The benefit is

Re: extract string from filename

2006-01-13 Thread Larry Cook
Zhao Peng wrote: My goal is to : 1, extract string2 from each file name 2, then sort them and keep only unique ones 3, then output them to a .txt file. (one unique string2 per line) It is really interesting how many ways there are to do things in *nix. My first reaction, if this is a one

Re: extract string from filename

2006-01-13 Thread Zhao Peng
Kevin, Thank you very much! I really appreciate it. I like your find approach, it's simple and easy to understand. I'll also try to understand your perl approach, when I got time to start learning it. (Hopefully it won't be un-fulfilled forever) I have one more question: Is it possible to

Re: extract string from filename

2006-01-13 Thread Jeff Kinz
On Fri, Jan 13, 2006 at 11:40:26AM -0500, Zhao Peng wrote: Kevin, Thank you very much! I really appreciate it. I like your find approach, it's simple and easy to understand. I'll also try to understand your perl approach, when I got time to start learning it. (Hopefully it won't be

Re: extract string from filename

2006-01-13 Thread Ben Scott
On 1/13/06, Zhao Peng [EMAIL PROTECTED] wrote: Is it possible to number the extracted string2? find -name \*sas7bdat -printf '%f\n' | cut -d _ -f 2 | sort | uniq | cat -n Run that pipeline in the directory you are interested in. The find(1) command finds files, based on their name or other

Re: extract string from filename

2006-01-13 Thread Ben Scott
On 1/13/06, Ben Scott [EMAIL PROTECTED] wrote: On 1/13/06, Zhao Peng [EMAIL PROTECTED] wrote: Is it possible to number the extracted string2? find -name \*sas7bdat -printf '%f\n' | cut -d _ -f 2 | sort | uniq | cat -n I forgot to mention: If the *only* files in that directory are the ones

Re: extract string from filename

2006-01-13 Thread Michael ODonnell
cat -n will number output lines ___ gnhlug-discuss mailing list gnhlug-discuss@mail.gnhlug.org http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss

Re: [gnhlug] Re: How to find rpms for various distros?

2006-01-13 Thread Donald Leslie {74279}
Bill McGonigle wrote: On Jan 13, 2006, at 10:26, Ben Scott wrote: Once I added the dag repository to my YUM configuration, I find I can usually find any given package by doing yum install foo or yum search foo. I'll second Ben's

[gnhlug] Re: How to find rpms for various distros?

2006-01-13 Thread Donald Leslie {74279}
Bill McGonigle wrote: On Jan 13, 2006, at 10:26, Ben Scott wrote: Once I added the dag repository to my YUM configuration, I find I can usually find any given package by doing yum install foo or yum search foo. I'll second Ben's

Re: BSD User's group?

2006-01-13 Thread Tom Buskey
On 1/13/06, Bill McGonigle [EMAIL PROTECTED] wrote: On Jan 12, 2006, at 17:27, Martin Ekendahl wrote:Too much eye candy or something, I can't put my finger on it. I like my console! init 3will take care of that problem for you. also rpm --erase rhgbto get rid of that stupid graphical boot screen

Re: extract string from filename

2006-01-13 Thread Dan Jenkins
Zhao Peng wrote: string1_string2_string3_string4.sas7bdat abc_st_nh_num.sas7bdat abc_st_vt_num.sas7bdat abc_st_ma_num.sas7bdat abcd_region_NewEngland_num.sas7bdat abcd_region_South_num.sas7bdat My goal is to : 1, extract string2 from each file name 2, then sort them and keep only unique ones

Re: How to find rpms for various distros?

2006-01-13 Thread Bayard Coolidge
Well, I've been running SuSE for a long time, since about 7.3 or so,so I'm a bit apprehensive about mixing packages between distributionsunless I'm REALLY sure about what's going to be put where."xdiif/mgdiff for rel4" is a bit confusing to me - what's "rel4" ? If you'rereferring to a Fedora

Re: extract string from filename

2006-01-13 Thread Paul Lussier
[EMAIL PROTECTED] (Kevin D. Clark) writes: Zhao Peng writes: I'm back, with another extract string question. //grin find FOLDERNAME -name \*sas7bdat -print | sed 's/.*\///' | cut -d _ -f 2 | sort -u somefile.txt Or, to simplify this: find ./ -name \*sas7bdat | awk -F_ '{print $2}'

Re: extract string from filename

2006-01-13 Thread Paul Lussier
Tom Buskey [EMAIL PROTECTED] writes: Unix Shell Programming by Kochan and Wood is a classic on shell programming Portable Shell Programming by Blinn The Awk Programming Language by Aho, Weinberger and Kernighan I'm also a big fan of Kernighan and Pikes, The UNIX Programming Environment.

Re: Two-week alert! Python for 2006 - first meeting January 26

2006-01-13 Thread Paul Lussier
Bill Sconce [EMAIL PROTECTED] writes: P.S. Have you noticed that almost every issue of Linux Journal now seems to have an article whose tone essentially takes it for granted that the obvious language for demonstrating some neat new application is Python? Tomorrow, world domination... No,