Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
finding a string from text
Name: krsatya Date: April 29, 2007 at 08:58:13 Pacific OS: hpux CPU/Ram: 4gb Product: HP
Comment:
there is a txt doc that i have. i have to find a string which is in middle of the line and if it finds that string then my script sshould output the whole line and also 4 more lines which come after 5 or 6 lines..i m not able to do this using awk.. here is a sample file <BasketTab state="INSERTED">MyBasketsTab</BasketTab> <Locale state="INSERTED">en_US</Locale> <UserKey state="INSERTED">323213</UserKey> <CountryLookupType state="INSERTED">Country</CountryLookupType> <BasketLookupType state="INSERTED">BasketType</BasketLookupType> <SortOrder state="INSERTED">ASC</SortOrder> <OACountries state="INSERTED">170,1050</OACountries> <SearchCountry state="INSERTED">0</SearchCountry> <SearchBasketName state="INSERTED">NULL</SearchBasketName> <SearchOriginatorName state="INSERTED">NULL</SearchOriginatorName>
i want to check if line contains "mybasketstab" or not and if yes , i want that line and last 2 lines to be outputted to a diff txt file
Summary: I have an output file from a CAD program. In it, I have CG and MOI data. When I see a string that tells me, "CG about CSY origin:", I want to capture the very next line -- the XYZ data. For other s...
Summary: You can find a string length any number of ways. The korn shell has a length operator: var="mystring" len=${#var} echo $len # shows 8 For older shells like the Bourne shell, you can also use external ...
Summary: I need to create a script, taking a number of parameters (a target string, a string to replace the target string, and a number of files), that performs the substitution and a backup file creation whe...