![]() |
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 |
| Grepping the last 30 minutes of a log file... | jtelep | Shell Programming and Scripting | 2 | 03-06-2008 12:27 AM |
| grepping for period . in file name ? ie grep . | bobk544 | UNIX for Dummies Questions & Answers | 5 | 12-01-2007 02:31 AM |
| Grepping Errors in a file | achararun | Shell Programming and Scripting | 4 | 02-05-2007 03:36 AM |
| Loop and grepping into a file | skotapal | Shell Programming and Scripting | 3 | 08-26-2002 09:28 PM |
| grepping the first 3 characters from a file | rachael | UNIX for Dummies Questions & Answers | 2 | 10-15-2001 02:33 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
grepping the first 3 characters from a file
Hi
I was wondering if it's possible to use a command to get the first 3 characters of a line in a text file, I tried grep but it returns the whole line but I am only interested in the first 3 characters. Is this possible with grep or I need any other command? Also is it possible deleting from a position to another in VI? For example delete from posistion 1 to 10 in all lines, I searched the whole VI man page but I couldnt find anything, only how to delete lines and words Cheers |
|
||||
|
In VI it is possible to delete from lines doing the following:
:1,5s!^[^|][^|]!! This will delete from line 1 to 5 the first two charachters it comes across. The ^ is beginning of the line and [^|] is each charchter you would want to delete. All lines could be done with: %s!^[^|][^|]!! Hope it helps ![]() |
![]() |
| Bookmarks |
| Tags |
| grep or |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|