Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by RVSachin

  1. RVSachin

    AWK : How to extract the path within each line

    Thanks PHV! It works! I am not too familiar with AWK. Would you mind explaining how this works!
  2. RVSachin

    AWK : How to extract the path within each line

    awk '{print $NF}' prints the last field, but do I grep a path which is somewhere within each line that starts with a charecter // for e.g., following line is one of the lines of my file. I need to just extract the path //mymachine/myfolder/mysubfolder ignoring all other contents of each line...
  3. RVSachin

    Find and replace a string in all files of a directory

    Thanks PHV, It's seems like you have a solution for every problem. Thanks to others as well.
  4. RVSachin

    VHDL constants, use statement, and search path

    It all depends on the tool you use. Just add all the vhdl files into your project and the tool will take care of the files, and their paths, irrespective of whether both the package file and the main file are in the same directory or not. You probably have to just add the package file into...
  5. RVSachin

    code

    You can use WHEN-ELSE construct for this. If temp is your output signal, then use the following code. temp <= "00001001" when mode = '0' else "10010010"; If the mode can take more values, then may be you can use the ROM coding style. Case (mode) is when "0000" temp <= "0001"; when...
  6. RVSachin

    Find and replace a string in all files of a directory

    Hi, The following command appends the contents of myfil.txt to each *.scr file in each folder under the directory maindir. find maindir -name '*.scr' | while read f; do cat /path/to/myfil.txt >> "$f"; done My question is, how can we "find and replace a string" in all the *.SCR files in each...
  7. RVSachin

    Extract data under a particular user name...

    Hi, I have a huge output file which contains data about some users. Report for each user starts with the following line in the file. Detailed Report for User: <user name> ....some data... Detailed Report for User: <USER NAME I AM INTERESTED IN> ....some other data... Detailed Report...
  8. RVSachin

    FIND & exec

    Hi, I have to append the content of the file myfil.txt to each *.scr file found in every sub-folder under the main directory "maindir" Each *.scr file has a unique name. Someone in the forum suggested the following command: find maindir -name *.scr -exec cat /path/to/myfil.txt >> {} \; But...
  9. RVSachin

    IF-THEN : expression syntax error

    Hi, Can somebody point me why I get "expression syntax error" for the following Korn shell script? x=`awk '/Info: .*.abc/{print $2}' results.log` y=`awk '/Info: .*.txt/{print $2}' results.log` z=`awk '/Total: /{print $2}' results.log` if [ $x == $z ]; then echo "match" >>...
  10. RVSachin

    print on single line after comparing the no. and GREP

    Can someone help me, please!
  11. RVSachin

    print on single line after comparing the no. and GREP

    Is there a easy way to do the following in (Korn) shell? My text file contains lines similar to the following, each on a different line: # reg1.inst_abc[0].a unmatched # reg1.inst_abc[1].a unmatched .... .... ..... # reg1.inst_abc[n].a unmatched # inst_abc[0].a unmatched #...
  12. RVSachin

    expression syntax error : The && construct

    Hi, Someone please help me to correct the 'expression syntax error' in the following Korn-shell script: if [ [ `grep -i "Info: .*.txt" results.log` ] && [ `grep -i "Total: " results.log` ] ] then x=`awk '/Info: .*.tam/{print $2}' results.log` y=`awk '/Total: /{print $2}' results.log`...
  13. RVSachin

    Check for presence of a file ....

    Hi, Someone please help me to find out the command/code which can check if a particular file has been created. I run a TCL script which will create a file fil.txt during the execution. In the same script I need to check for the presence of fil.txt and if it does exist, then exit the script or...
  14. RVSachin

    grep file paths in each line of text

    Hi PHV, Thanks for the solution. Can you please let me know how this works?..I mean, what does NF do? Thanks, Ravi
  15. RVSachin

    Grep and ls question.

    Sorry, That was a new thread, which accidentally got thro' as a reply to your thread. It was too late by the time I realized it. Sorry! RV

Part and Inventory Search

Back
Top