Search Results

Search: Posts Made By: bingel
22,671
Posted By bingel
As I said, the file is very large, so I would...
As I said, the file is very large, so I would stop the search soon after having found the first X occurrences. So, do you think that if I use the sub function instead of gsub, search will be faster?...
22,671
Posted By bingel
I need a code like this because, since I have a...
I need a code like this because, since I have a big file where to search, I would like to stop search at first 2 occurrences found but with gsub I think search is done until the end of file, instead...
22,671
Posted By bingel
Thanks, but using awk and gsub? I don't know...
Thanks, but using awk and gsub?

I don't know ruby and I would like to use awk because so I could adapt the script to my needs.

Thanks again

---------- Post updated at 04:44 PM ----------...
22,671
Posted By bingel
awk and gsub - how to replace only the first X occurrences
I have a text (text.txt) and I would like to replace only the first 2 occurrences of a word (but I might need to replace more):

For example, if text is this:

CAR sweet head
hat red yellow
CAR...
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 07:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy