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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: RVSachin
  • Order by date
  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
  16. RVSachin

    grep file paths in each line of text

    Hi, My text file contains something like following: adsdfaddfd <some path1> adlfjakflafaf /<some path2> adfabzlhzxhledfdfe3dfstet <some path3> d3dfstet <some other path> How do I print or redirect only the path information to another file? That is, each line in second file should...
  17. RVSachin

    Grep and ls question.

    Hi, My text file contains something like following: adsdfaddfd <some path1> adlfjakflafaf /<some path2> adfabzlhzxhledfdfe3dfstet <some path3> d3dfstet <some other path> How do I print or redirect only the path information to another file? That is, each line in second file should...
  18. RVSachin

    Doesn't remove ALL the blank lines....

    Hi, I am trying to remove blank lines from a report by doing grep -v "^$" file1 > file2 such that file2 doesn't contain blank lines. Although it works on most of the blank lines, I still see few blank lines such as the one in the code. I am wondering why it doesn't remove *ALL* blank lines in...
  19. RVSachin

    Appending same file content to a unique file in each sub-directory

    Hi, I have a file abc.prj in each of many subdirectories. I need to append the contents of myfil.txt to every abc.prj file in the same subdirectories. Can somebody please help me out on this? The structure is as follows: Main ---| |subdir1 --> abc.prj |subdir2 --> abc.prj...
  20. RVSachin

    appending common content to every *.prj file in subdirectories

    Hi, I have a file abc.prj in each of many subdirectories. I need to append the contents of myfil.txt to every abc.prj file in the subdirectories. Can somebody please help me out on this? The structure is as follows: Main ---| |subdir1 --> abc.prj |subdir2 --> abc.prj |subdir3 --> abc.prj...

Part and Inventory Search

Back
Top