Sponsored Content
Full Discussion: Filename Manipulation in AWK
Top Forums UNIX for Dummies Questions & Answers Filename Manipulation in AWK Post 302321750 by sivakumar.rj on Tuesday 2nd of June 2009 04:41:07 AM
Old 06-02-2009
Filename Manipulation in AWK

I have created a nawk program and passing a file as an input parameter.
The filename will be /home/dir/ksh/test.out

I need to extract the filename alone. Is there anyway to get this ?

Input : /home/dir/ksh/test.out
Output -1: test.out
Output -2 : t

Input : /home/dir/kshfiles/file.out
Output -1: file.out
Output -2 : e

And from this output I need to extract the particular 4th character from the last. The filename and the directorynamewill get vary each and every time. So I need to manipulate from the last.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk manipulation

Hi , what a wonderful command but so hard to maintain ! i have a file like that : 03/07/2006 05:58:45 03/07/2006 06:58:45 03/07/2006 07:58:50 03/07/2006 08:58:50 and i want to read it and keep only the lines with 3rd field less than 07:00:00 writing it in a second file ! ... (2 Replies)
Discussion started by: Nicol
2 Replies

2. Shell Programming and Scripting

gzcat into awk and then change FILENAME and process new FILENAME

I am trying to write a script that prompts users for date and time, then process the gzip file into awk. During the ksh part of the script another file is created and needs to be processed with a different set of pattern matches then I need to combine the two in the end. I'm stuck at the part... (6 Replies)
Discussion started by: timj123
6 Replies

3. Shell Programming and Scripting

$0 manipulation in awk

OK, so if $0 represent the entire record... can I change $2 and will that be reflected back in $0? I think the following answers that YES, it does work. But is there anything I should be thinking about prior to doing this? What I am actually doing is part of 5 pages of scripting and awk... (1 Reply)
Discussion started by: joeyg
1 Replies

4. Shell Programming and Scripting

filename manipulation using "sed"

Dear all, I need to manipulate some filenames (dump.1, dump.2, etc.) and feed them to another command. For this purpose I am using sed and because my last COMMAND needs to receive files one-by-one I am using xargs: >> ls dump.* | xargs sed -n 's/expression1/expression2/' | COMMAND The... (4 Replies)
Discussion started by: bigboss010
4 Replies

5. UNIX for Dummies Questions & Answers

File manipulation via awk

Hello, I am having issues generating the output file below from this input file: Basically, what I want is if the ID= matches with the line below to print the first value in column 3 and the last value of column 4 for the matching ID's. The ID's can repeat more than twice, however, they... (2 Replies)
Discussion started by: verse123
2 Replies

6. Shell Programming and Scripting

Filename manipulation

Hi all, I need to convert some files with the following name format: <Base File Name>_YYYYMMDD_HHMISS_NNNNN.* to: NNNNNN_<Base File Name>_YYYYMMDD_HHMISS.* Example: MY_FILE_NAME_20120912_123443_12345.data will be converted to 012345_MY_FILE_NAME_20120912_123443.data Notice that... (9 Replies)
Discussion started by: schweinshaxe
9 Replies

7. Shell Programming and Scripting

awk manipulation

Hallo Family, I have csv file which has over a million records in it. All i want to do is to change field 2 to have the same value as field 10. sample file:Now 0860093239,Anonymous,unconditional,+27381230283,Anonymous,unconditional,y,public,,2965511477:0A Desired output: ... (2 Replies)
Discussion started by: kekanap
2 Replies

8. Shell Programming and Scripting

awk manipulation

hello I have example file AA 11 BB 22 CC 33 And what I expect to have -a AA=11 -a BB=22 -a CC=33 can anyone help how I have this using awk? (1 Reply)
Discussion started by: vikus
1 Replies

9. Shell Programming and Scripting

Array manipulation with awk?

Dear friends, I'm wondering if we could do some simple math on two arrays with the same size? a1 Fe -0.21886700 -0.01417600 -0.24390300 C 2.20529400 0.89434100 -0.61061000 C -1.89657700 -0.74793000 -0.07778200 C ... (8 Replies)
Discussion started by: liuzhencc
8 Replies

10. Shell Programming and Scripting

awk manipulation

Hello all, Can someone help me with write part of code in awk to merge 2 files? Go through file1 check if number from column 3 exist in file2(column 2) if yes take value from column 1 and add to column 4 in file1. If value in column 4 exist in file1 skip it. file1... (2 Replies)
Discussion started by: vikus
2 Replies
ASN2FF(1)						     NCBI Tools User's Manual							 ASN2FF(1)

NAME
asn2ff - convert ASN.1 biological data to a flat format (old version) SYNOPSIS
asn2ff [-] [-A X] [-B X] [-C] [-G] [-L F] [-M] [-R] [-V F] [-a filename] [-b] [-d] [-e] [-f b/p/e/s/x/z] [-g] [-h F] [-k F] [-l filename] [-m r/d/s/c/k/l/e/p] [-n F] [-o filename] [-p F] [-q] [-r filename] [-s] [-t] [-v F] [-w] [-y] [-z] DESCRIPTION
asn2ff converts descriptions of biological sequences from NCBI's ASN.1 format to one of several flat-file formats. This program is built around a deprecated interface; please use asn2gb(1) instead. OPTIONS
A summary of options is included below. - Print usage message -A X Show region starting at X (default is 0) -B X Show region ending at X (default is last position) -C Show Bankit comments -G Output is one top bioseq only in genome view -L F Use old (pre-Genbank 127.0) LOCUS line format -M Output is map bioseqs only -R For GenBank Release -V F Don't use VERSION -a filename Filename for ASN.1 input (default is stdin) -b Input asnfile in binary mode -d Use SeqMgr indexing -e Input is a Seq-entry -f b/p/e/s/x/z Output Format: b GenBank (default) p GenPept e EMBL s PseudoEMBL x GenBankSelect z EMBLPEPT -g Show gi numbers -h F Hide sequence -k F Don't use complex sets (phy-set,mut-set, pop-set) -l filename Log errors to filename -m r/d/s/c/k/l/e/p Output mode: r release (default) d dump s Sequin c Chromoscope k dir-sub-debug l dir-sub e revise p partial report -n F Strict gene_binding -o filename Output Filename (default is stdout) -p F Omit new gene features -q Output is one top bioseq only -r filename Output error logfile (default is stderr) -s Input is a Seq-submit -t Show verbose message text -v F Suppress error messages -w Use HTML output format -y Print help format only -z New algorithm for orgnames AUTHOR
The National Center for Biotechnology Information. SEE ALSO
asn2all(1), asn2asn(1), asn2fsa(1), asn2gb(1), asn2xml(1), asndhuff(1). NCBI
2005-05-16 ASN2FF(1)
All times are GMT -4. The time now is 09:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy