![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| command line args 2 | skooly5 | UNIX for Dummies Questions & Answers | 2 | 04-06-2008 09:36 PM |
| command line args | skooly5 | UNIX for Dummies Questions & Answers | 2 | 04-06-2008 07:46 PM |
| Command line args | enuenu | High Level Programming | 2 | 05-29-2007 12:19 AM |
| alias with args how to ... | umen | UNIX for Dummies Questions & Answers | 4 | 12-28-2005 07:47 AM |
| Args to Array | Shaz | Shell Programming and Scripting | 2 | 06-30-2003 04:11 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
args of 50+ files
Hey..
I've gotten inspired by another thread and used this: #!/usr/bin/bash args 2,5 $(<file.list) It works but I'll like the results separated into different files or back into the 'used'/original files, whatever is easiest. e.g. use fileA | args 2,5 > fileB or fileA and then do this to 50 files (I thought the idea with the list of files to be handy). Is there an easy way? Thanks! |
|
||||
|
Sorry. Forgot that args is only on our 'server'. Yes, it's a script that 'takes' the stated arguments in the given line/file.
In this case it 'takes' argument 2 and 5 and paste them. Basicly what I need to do is to 'take' two columns out of a file and repeat that for 50 files. Please let me know if I still don't make sense.. Thanks! |
|
||||
|
help wanted!!
OK.
This is what I have: Code:
C 306 P B 85 V 3.46 C 307 K B 81 H 2.69 C 307 K B 85 V 3.43 C 309 V B 82 N 2.67 C 309 V B 78 Y 3.23 C 309 V B 81 H 3.42 C 311 Q B 78 Y 3.46 Code:
306 85 307 81 307 85 309 82 309 78 309 81 311 78 Code:
306 85 307 81,85 309 82,78,81 311 78 Hope it makes sense now. Thanks for replying. Last edited by lost; 11-19-2008 at 01:43 PM.. |
|
|||||
|
Quote:
Code:
awk '{printf ($2 in a) ? ","$5 : (NR>1) ? RS $2 FS $5 : $2 FS $5; a[$2]} END{print e}' file
Output: Code:
306 85 307 81,85 309 82,78,81 311 78 |
|
||||
|
YOU'RE A STAR!!!!!!!!
THANKS YOU SO MUCH!!! yippiyeah.... yippiyeah..... ;D Sorry I didn't get the thing with the for loop for the files, because how do I make the output from each file separated into individual files? Any way I'm so glad it works so even though it's stupid I can manually do the repeats for all the files... |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| shell script, shell scripting, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|