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 Mike Lewis 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: *

  1. bansalhimanshu

    Comment more than one line in vi

    You can use commands like the following in vi editor: :%s/^/#/g or :%s/^#//g You can replace % with the range of numbers like :1,5s/^/#/g Or can use ., $ for current position and end of file respectively.
  2. bansalhimanshu

    Chop the file into small pieces

    Thanks Feherke. This is very valuable information. Even I tried the same queries and had the following results first and last query only I mention (in consistent with yours): time { C=0; I=1; R=0; while [ $C -lt 1000000 ]; do let R=$R+$I; let C=$C+1; done } real 0m53.28s user 0m53.22s sys...
  3. bansalhimanshu

    Shell script: File watcher

    RodKnowIton, Can you please look at this code: [bansah01@:/h/bansalh01/temp]more test.sh #!/bin/ksh a=1 while [ "$a" ] do echo "-$a- is the value" read a done Execution : ------------ [bansah01@:/h/bansalh01/temp]test.sh -1- is the value 2 -2- is the value 3 -3- is the value 4 -4- is...
  4. bansalhimanshu

    Script

    I tried doing and it worked: ftp> quote site chmod 666 hi 200 CHMOD command successful.
  5. bansalhimanshu

    Chop the file into small pieces

    feherke, I happened to test the difference in time when using expr and using let. I found a huge difference. With the following script: #!/bin/ksh #Usage $0 <startcount> <quantity> <incrementby> NUMARGS=$# if [ ${NUMARGS} -lt 3 ] then echo "Usage $0 <startcount> <quantity> <incrementby>"...
  6. bansalhimanshu

    Any utility/command for splitting of a big file?

    Thanks Feherke, it worked fine. mrn as per your suggestion I was looking to find out the quantity of suffix. I could not understand your solution but got this one (may be this is what you were referring to): Size of suffix = log (number, basename) where number = (total number of lines in big...
  7. bansalhimanshu

    Any utility/command for splitting of a big file?

    But does it work when the number of files is greater than 676?
  8. bansalhimanshu

    Chop the file into small pieces

    Probably this condition $(($CHECKVALUE = "END")) is not getting satisfied after the first initialization of FILENAME. So the first file is getting created and subsequently no one. Check 1) if you are assigning to the variable CHECKVALUE correctly (contents of a line) 2) Will the appearance of...
  9. bansalhimanshu

    Chop the file into small pieces

    Also as suggested by PHV and feherke, these are the changes I made to the original script: #!/bin/ksh NUMOFARGS=$# if [ $NUMOFARGS -lt 2 ] then echo "Invalid usage" echo "Usage: $0 <FileName> <NumberOfLines>" exit 1 fi INPUTFILENAME=$1 NUMBEROFLINES=$2 LINECOUNTER=0 FILECOUNT=1...
  10. bansalhimanshu

    Chop the file into small pieces

    Thanks PHV and feherke for your replies. It was very useful to me.
  11. bansalhimanshu

    Chop the file into small pieces

    Thanks PHV. I could use let for assigning value to a variable. Can I do something about :- if [ "`expr $LINECOUNTER % $NUMBEROFLINES`" -eq "0" ] Also, how can I avoid using cat.
  12. bansalhimanshu

    Chop the file into small pieces

    Please tell me how.
  13. bansalhimanshu

    Any utility/command for splitting of a big file?

    I was using split for the purpose but it has a limitation of 676 files. I could not understand how to split a file based on lines numbers using csplit. Can you elaborate. I need a large file to be split into a large number of files containing 2 lines of the larges file. The number of splitted...
  14. bansalhimanshu

    Chop the file into small pieces

    You can modify the following script to your needs (you just need to change the end of file indication condition whereby I am using line counts): #!/bin/ksh NUMOFARGS=$# if [ $NUMOFARGS -lt 2 ] then echo "Invalid usage" echo "Usage: $0 <FileName> <NumberOfLines>" exit 1 fi...
  15. bansalhimanshu

    Any utility/command for splitting of a big file?

    Please tell me a unix command or utility for splitting of a very big text file into small files of say 2 lines each. For now I wrote my own script to do the job but I am looking for some standard command/utility.
  16. bansalhimanshu

    Mobile phone frequency in India?

    I bought the unlocked cell phone Nokia 3220 which runs on bands 850/1800/1900. Can somebody please tell me if this phone will work in India or not?
  17. bansalhimanshu

    Find number of occurences of a string/character in a file

    Thanks Annihilannic, it was very really good. This script although does not work for searching for count of word. Can you write similar script for a word as well. Are you aware if there is any unix inbuild command for this purpose.
  18. bansalhimanshu

    Find number of occurences of a string/character in a file

    I need to find the count of a character or a set of characters in a file. Is there a unix command for that? Like for given file I need to find out number of occurences of "af": afbcd efg abef akljklj jklj ljlj ljlkj jflja fjklja j ljkfaj jkj jljaf jflaj jafj;ajj;jj jlkj;
  19. bansalhimanshu

    Writing shell script which takes flags as input

    I want to write shell script which takes some flags along with input parameters. What I mean is like ls which can take input as parameters filename/file directory alongwith flags like -l, -m, -a etc. ls -latr *.txt This way I want to write my script as myscript -w myinput Also do correct me...
  20. bansalhimanshu

    Cursor fetches less than expected records

    This problem was coming because there was no unique index made on the table. When I made the unique index on the table then the cursor started fetching all the records.

Part and Inventory Search

Back
Top