![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to rename multiple files with a single command | tayyabq8 | Shell Programming and Scripting | 5 | 03-18-2008 12:04 PM |
| Splitting my program to multiple source files. | the_learner | High Level Programming | 6 | 06-04-2007 07:53 AM |
| can you redirect multiple files for input? | Matrix_Prime | UNIX for Dummies Questions & Answers | 4 | 02-27-2005 03:07 PM |
| Perform a command to multiple files | mcgrawa | UNIX for Dummies Questions & Answers | 4 | 09-25-2003 01:40 AM |
| find files and using them as input arguements for another command | bobbygrep | UNIX for Dummies Questions & Answers | 1 | 07-18-2001 02:24 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi,
I needs to split *.txt files from single directory depends on the some mutltiple input values. i have wrote the code like below for file in *.txt do grep -i -h "value1|value2" $file > $file; done. My requirment is more input values needs to be given in grep; let us say 50 values($value1,$value2.....$value50). is there any good way of writing the code. example aaa 1111 ee3456 bbb 2222 bb7658 kkk 8888 nn1234 hhh 5555 bb4444 lll 9999 ee0987 Also is it possible to split the file starting from 11th position to 15th position; becaz i want split the file by considering position from the files so that my input values will reduce. like in exapmle(there are repeted values ee bb nn bb ee etc) from the file. is that can be achived through AWK command? Thanks in advance. |
| Forum Sponsor | ||
|
|
|
|||
|
yes. I need to split the files according to given input values. Only thing is input values are almost 50. But if consider the position the input values will become less as shown below.
aaa 1111 ee3456 bbb 2222 bb7658 kkk 8888 nn1234 hhh 5555 bb4444 lll 9999 ee0987 if you aboserve the above in 3rd colomn first 2 letters are repeating. so if i consider the position (11th to 15th). i can give only 10 input values. |
|||
| Google UNIX.COM |