Sponsored Content
Full Discussion: Combination awk and rename
Top Forums Shell Programming and Scripting Combination awk and rename Post 302844159 by Corona688 on Friday 16th of August 2013 05:27:27 PM
Old 08-16-2013
I think you can do something lke
Code:
awk '/Sample ID/ { print "echo mv test.pdf "$3".pdf"); }' sampleid.txt | sh

Remove the echo once you're sure it does what you want.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

awk and file combination

Hi there, I have 3 files and i want to take different fields from each file and combine them in one. I would like to ask if somebody tell me how can I refer to each field of the different files to write an awk command. I mean can I do sth like awk '........... print $1.file1 $3.file2}'... (1 Reply)
Discussion started by: sickboy
1 Replies

2. Shell Programming and Scripting

Sed Awk Cut Grep Combination Help ?

I have been reading for a few hours trying to educate myself enough to accomplish this task, so please know I have performed some research. Unfortunately, I am not a *NIX scripting expert, or a coder. I come from a network background instead. SO, here is my desired outcome. I have some Cisco... (5 Replies)
Discussion started by: abbzer0
5 Replies

3. Shell Programming and Scripting

awk split and rename files

I have a file test1.html like below: <dctm_topnav_en_US> <html> ..... </html> <dctm_topnav_en_CA> <html> ..... </html> <dctm_topnav_en_FR> <html> ..... </html> I need to use awk to split this into three file names like en_US.html , en_CA.html, en_FR.html each having content between... (4 Replies)
Discussion started by: vijay52
4 Replies

4. Shell Programming and Scripting

Using a combination of sort/cut/grep/awk/join/paste/sed

I have a file and need to only select users that have a shell of “/bin/bash” in the line using awk or sed please help (4 Replies)
Discussion started by: boyboy1212
4 Replies

5. Shell Programming and Scripting

help with awk for file combination

1)file1: | *Local Communication Bandwidths (MB/Sec) | Memory copy (bcopy) | | ^ | mmap_bandwidth | | ^ | mmap_read bandwidth | | ^ | memory write bandwidth | | Local Communication Latencies | Pipe Latency | 2)file2 422.6903 1948.9000 ... (9 Replies)
Discussion started by: yanglei_fage
9 Replies

6. Shell Programming and Scripting

Rename file using sed or awk

I have a filename like 1_DATE_3_4.5_888 and I want to modify the date field (ie the last 4 digits ) alone and remove the last field. Old filename:1_DATE_3_4.5_888 Given date (for eg):120606259532 modified date:120606259899 new filename:1_<modified date>_3.4.5 (14 Replies)
Discussion started by: sandy88
14 Replies

7. Shell Programming and Scripting

Considerable trouble with for loop in combination with awk

I have the text file where each line has the format: chr10 101418889 101418904 0.816327 Right now the interval between column 2 and 3 is 15. I only want the two consecutive positions starting at position 1, write it to a file, then move up one position write to file etc. So that: ... (1 Reply)
Discussion started by: jfern
1 Replies

8. Shell Programming and Scripting

awk and rename ?

I have a log file from /m/n/o/A.log with 1 line current content: 19518634,SW,windows_x86_64 and an folder from /x/y/z/testit_folder How do you write a shell script to rename test_folder to changed_monthdate_19518634 If today is 04/23 the name should be changed_0423_19518634 Thanks for your... (1 Reply)
Discussion started by: sabercats
1 Replies

9. Shell Programming and Scripting

awk to count and rename based on fields

In the below awk using the tab-delimited input, I am trying count the - symbol in $5 and output the count as well as the renamed condition ins. I am also count the - symbol in $6 and output the count as well as the renamed condition del. I am also count the tomes that in $5 and $6 there are... (6 Replies)
Discussion started by: cmccabe
6 Replies

10. Shell Programming and Scripting

awk or a combination of commands to read and calculate nth lines from pattern

Two numerical lines, found by either header line, need to be added and the total placed in a new-header section. Also the total should should be rounded or cut to a two decimal anynumber.XX format with the AB string added on the end. For example: The numerical lines from headers 2 and 3 are... (3 Replies)
Discussion started by: jessandr
3 Replies
MONGOFILES(1)							  Mongo Database						     MONGOFILES(1)

NAME
mongofiles - a simple GridFS interface SYNOPSIS
mongofiles [OPTIONS] DESCRIPTION
mongofiles is used to list, get, and insert files in the database. EXAMPLES
mongofiles list lists files in test.fs.files mongofiles put README.txt inserts the file README.txt into the collection test.fs.files mongofiles get photo.jpg retrieves photo.jpg from test.fs.files and saves it locally OPTIONS
--help show usage information -h, --host HOST mongo host to which to connect -d, --db DB database to use (default DB=test) -c, --collection COLLECTION (default COLLECTION=fs.files) collection to use --command [list|search|put|get] execute a command --file FILE filename for get or put list list all files. takes an optional filename. the file has to start with the filename search search all files for something that contains the string COPYRIGHT
Copyright 2007-2009 10gen SEE ALSO
For more information, please refer to the MongoDB wiki, available at http://www.mongodb.org. AUTHOR
Kristina Chodorow 10gen June 2009 MONGOFILES(1)
All times are GMT -4. The time now is 01:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy