![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 4 GB delimited-textfile on ONE LINE | magedfawzy | Shell Programming and Scripting | 5 | 05-13-2009 04:12 AM |
| Reading a file line by line and processing for each line | sagarparadkar | Shell Programming and Scripting | 6 | 03-02-2009 11:59 AM |
| To substitute a string in a line to another string | Niroj | Shell Programming and Scripting | 4 | 10-31-2008 04:23 AM |
| search for a string ,replace the whole line with new line | kkraja | Shell Programming and Scripting | 4 | 08-07-2008 03:26 AM |
| How I Can get String From the Line | habuzahra | UNIX for Dummies Questions & Answers | 2 | 10-29-2006 07:55 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
cut a string in a textfile line per line
i need to cut the string in a textfile but each line has a specific way of cutting it (different lengths) i have a for loop that gets the string line per line, then each line has to be compared: Code:
for x in `cat tmp2.txt`; do
if[ "BAC" == _____ ]; then
echo 'BAC'
elif[ "sdf_ada" == _____]
etcetc
fi
done
sample tmp2.txt file that needs to be trim to specific length : BAC0904102604 -> BAC AFR0904102604 -> AFR HHF0904102604 -> HHF UI100904102907 ->UI10 sdf_ada_9541-9543.1 -> sdf_ada _fsf13145533 ->fsf note: the file is in random order. Last edited by bakunin; 05-05-2009 at 07:07 AM.. Reason: added code-tags. Please do that yourself from now on. Thanks |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|