Sponsored Content
Top Forums UNIX for Dummies Questions & Answers awk to parse a directory name? Post 302321961 by vgersh99 on Tuesday 2nd of June 2009 12:00:50 PM
Old 06-02-2009
Code:
echo '/auto/space/user/jen/CED/CED_01MZ/visit1/DCE_2eco/016/echo1' | nawk -v d='/auto/space/user/jen/CED/CED_01MZ/' '$0 ~ "^" d {match($0,d "[^/][^/]*"); print "var1 = " substr($0, RSTART, RLENGTH-1) ORS "var2 = " substr($0, RLENGTH+2)}'

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

AWK unable to parse

awk -v new=" " ' substr($0, 17, 3) == "ABC" && substr($0, 52, 8) == "00000000" { tr=substr($0, 20, 10); ap=substr($0, 30, 2); ver=substr($0, 32, 2); irver=substr($0, 34, 2); ... (12 Replies)
Discussion started by: COD
12 Replies

2. Shell Programming and Scripting

to parse a directory and its subdirectories and find owner name of files

hi all, i need to capture all the files in a directory and its subdirectories that have owner name different than the root owner. for one file it is " stat -c %U filename " but i need to search for each and every file and record it. thanks in advance (14 Replies)
Discussion started by: vyasa
14 Replies

3. Shell Programming and Scripting

Parse file using awk and work in awk output

hi guys, i want to parse a file using public function, the file contain raw data in the below format i want to get the output like this to load it to Oracle DB MARWA1,BSS:26,1,3,0,0,0,0,0.00,22,22,22.00 MARWA2,BSS:26,1,3,0,0,0,0,0.00,22,22,22.00 this the file raw format: Number of... (6 Replies)
Discussion started by: dagigg
6 Replies

4. Shell Programming and Scripting

Script to parse filenames in a directory and do some actions

Hi All, I don't have much experience in scripting, and couldn't find anything that will help me to write a script I need, hopefully you can help me with it. I have lots of files in one directory with the following file name pattern: 100001-something.ext1 100101-something2.ext2... (4 Replies)
Discussion started by: troman
4 Replies

5. Shell Programming and Scripting

How to parse filename and one level up directory name?

Hello Experts, I need little help with parsing. I want to parse filename and one level up directory name. sample $1 will consists of /home/username/ABC1/rstfiles4.log /home/username/ABC4/rstfiles2.log /home/username/EDC7/rstfiles23.log /home/username/EDC6/rstfiles55.log... (8 Replies)
Discussion started by: Shirisha
8 Replies

6. Shell Programming and Scripting

Parse a file with awk?

Hi guys (and gals). I need some help. I'm running an IVR purely on Asterisk where I capture the DTMFs. After pulsing each DTMF I have Asterisk write to a file with whatever was dialed (mostly used for record-keeping) and at the end of the survey I write all variables in a single line to a... (2 Replies)
Discussion started by: tulf210
2 Replies

7. Shell Programming and Scripting

Parse files in directory and compare with another file

I have two files File 1 in reading directory is of following format Read 1 A T Read 3 T C Read 5 G T Read 7 A G Read 10 A G Read 12 C G File 2 in directory contains Read 5 A G Read 6 T C Read 7 G A Read 8 G A Read 20 A T File2 contains (1 Reply)
Discussion started by: empyrean
1 Replies

8. Shell Programming and Scripting

awk to parse df output

Output of the below code includes unmatched date.Please correct it df -k|awk '$4>50 {print $1, "\t"$4,"\t" $7}' It gives output less than 50% also. (5 Replies)
Discussion started by: vinil
5 Replies

9. Shell Programming and Scripting

Parse multiple html files in directory

I have downloaded source code for 97 files using: wget -x -i link.txt then run a rename loop: for file in * do mv $file $file.txt done to keep the html tags but make the file a text that can be parsed. In each of the 97 txt files the gene # is variable, but the gene is associated... (15 Replies)
Discussion started by: cmccabe
15 Replies

10. Shell Programming and Scripting

Parse Directory path - awk

Hi All, Need some help in parsing a directory listing .. output into 2 files Input file level1,/level2/level3/level4/ora001,10,IBB23 level1,/level2/level3/level4/ora001/blu1,,IBB23 level1,/level2/level3/level4/ora001/clu1,,IBB23 level1,/level2/level3/level4/ora002,,IBB24... (10 Replies)
Discussion started by: greycells
10 Replies
Sobol(3)						User Contributed Perl Documentation						  Sobol(3)

NAME
PDL::RandVar::Sobol -- Sobol subrandom sequences VERSION
Current version is 1.0 SYNOPSIS
use PDL::RandVar::Sobol; $m = new PDL::RandVar::Sobol DESCRIPTION
Sobol subrandom sequences are used for more uniform sampling of a domain than normal random variables can achieve. They're described cur- sorily in W.H. Press's _Numerical_ _Recipes_, 2nd edition, section 7.7 (Cambridge Univ. Press), and this implementation is based on their description. History 0.01 4-Dec-2001 -- Basic functionality (CED) 0.1 11-Dec-2001 -- First fully functional version (CED) 1.0 9-Jan-2002 -- Tests out OK (CED) Author, license, no warranty This file copyright(C) 2001, 2002 Craig DeForest (cdeforest@solar.stanford.edu). This software/documentation may be distributed under the same terms as PDL itself (license available at http://pdl.perl.org). This package comes with NO WARRANTY. Bugs: Should have a way of reproducibly seeding the initial values. For now, you always get the same initial seed with every random variable -- this is the Wrong way to do it. FUNCTIONS
new Construct a new Sobol subrandom variable Signature: (See PDL::RandVar::new) $a = new PDL::RandVar::Sobol(<size>,<opt>); Options: range 2xn piddle containing min and max values for each dimension. $a = new PDL::RandVar::Sobol(2,{range=>pdl([$xmin,$xmax],[$ymin,$ymax])}); $xy = sample $a; perl v5.8.0 2002-05-16 Sobol(3)
All times are GMT -4. The time now is 11:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy