User Profile

Collapse

Profile Sidebar

Collapse
sumittyagi
sumittyagi
Last Activity: Jul 14 '12, 06:18 AM
Joined: Mar 5 '07
Location: New Delhi, India
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • sumittyagi
    replied to bash script to run program N times
    use for loop construct, or while loop construct.. whichever you like.

    Google -> using loops in shell script

    Hope this helps

    Best Regards,
    Sumit.
    See more | Go to post

    Leave a comment:


  • sumittyagi
    replied to Joining(merging) two files.
    Yes, arrays solved it out. it took 3 full iterations (if there are 100 elements then 3X100=300 iterations => two for assignment and one for display).

    Any other improvement suggestion will be appreciated.
    See more | Go to post

    Leave a comment:


  • sumittyagi
    replied to Joining(merging) two files.
    I think arrays will solve my problem...

    Any other suggestions?
    See more | Go to post

    Leave a comment:


  • sumittyagi
    replied to Joining(merging) two files.
    I am half way through:-

    I tried to use join command, but it seems to compare in an ambiguous manner:-

    Below is the sample output:-
    file1 is:-


    file2 is:-


    join command gives output for one digit matches only for the key match column as shown below:-
    Code:
    join -j1 1 -j2 1 -o 0,1.2,2.2 -t " " file1 file2
    1 51 2605
    2 52 1486
    3 53 2783
    ...
    See more | Go to post

    Leave a comment:


  • sumittyagi
    started a topic Joining(merging) two files.

    Joining(merging) two files.

    Hi All,

    I am stuck with one tricky situation here.

    The situation is as follows:-
    I have two files, both files have two columns - space seperated key value pairs.

    Now say files are f1 and f2.
    and columns in f1 are f1c1, f1c2; and columns in f2 are f2c1 and f2c2.

    f2c1 is a subset of f1c1 (say keys).
    f1c2 and f2c2 are different (say values).

    Now I want to...
    See more | Go to post
    Last edited by sumittyagi; Sep 20 '09, 05:48 AM. Reason: spell correction

  • sumittyagi
    replied to sed to explode a full path
    why don't you just use basename and dirname commands.

    Code:
    basename /home/root/usr2/testdir1
    testdir1
    
    dirname /home/root/usr2/testdir1
    /home/root/usr2
    See more | Go to post

    Leave a comment:


  • sumittyagi
    replied to need help to extract tar.bz2
    Thanks everybody for the useful information and a very nice duscussion!
    See more | Go to post

    Leave a comment:


  • You can also use cmd (MS Dos) to transfer file through ftp. I normally use ftp for this purpose.

    run cmd and run the below commands on it.

    Code:
    cd <directory path where your source file is located.>
    ftp <aix server name/ip address>
    <give user id and password>
    cd <directory path where you want to put the file>
    put <file name>
    bye
    exit
    See more | Go to post

    Leave a comment:


  • sumittyagi
    replied to need help to extract tar.bz2
    If i want to tar and zip a directory, then can I use the following command?

    Code:
    tar -zcvf <directory_name> tar_file_name
    and also, will it tar and then zip the tar file, or it will zip all the files in the directory and then tar?
    See more | Go to post

    Leave a comment:


  • Question 1:- Why do you want to get available physical memory for the client. I can unerstand if someone wants know physical memory of the server (to know how much space is left to save/process data); But client acts only the role of presentation layer and submiting requests to the server.

    Question 2:- Why a client will allow accessing its physical memory when it knows there are lots of malicious scripts are waiting for such information....
    See more | Go to post

    Leave a comment:


  • sumittyagi
    replied to <jsp:include>
    in Java
    You must understand two things for developing web applications:-
    1. Client side programming (scripting).
    2. Server side programming.

    When client submits the request then(and only then) server gets the control.
    Now you want to control how client submits the request, so that needs client side scripting (server can't help you in this as he is sitting miles away from your computer).

    Now what is AJAX!...
    See more | Go to post

    Leave a comment:


  • sumittyagi
    replied to Java beans question
    in Java
    try to include footer.jsp using <jsp:include tag.
    See more | Go to post

    Leave a comment:


  • sumittyagi
    replied to <jsp:include>
    in Java
    You can achieve this by using ajax.
    See more | Go to post

    Leave a comment:


  • I agree with Dormilich, I faced the same problem with another name conflict. So always use variable names that do not conflict any predefined js functions or variables.
    See more | Go to post

    Leave a comment:


  • I just forgot to tell you that images takes their own request, and each image display needs to be treated as separate request.

    See this thread for a discussion on the same topic....
    See more | Go to post

    Leave a comment:


  • sumittyagi
    replied to replacing comma with newline
    Thanks a lot Bernd,
    I will try it out!!!

    Regards,
    Sumit Tyagi...
    See more | Go to post

    Leave a comment:


  • sumittyagi
    replied to replacing comma with newline
    I actually wanted to get a csv file for a result from a sql query.

    The file is getting created, but I suppose unix don't treat \n as newline. It is replacing \n by a space in the file.

    I also tried \r\n like this:

    nawk 'ORS=NR%3?RS:"\ r\n"' RS="," filename

    In this case, newline is done but the file gets truncated abruptly in between when I use cat, pg or vi to see the...
    See more | Go to post

    Leave a comment:


  • sumittyagi
    replied to replacing comma with newline
    Thanks a lot for your replies!
    It worked!!!...
    See more | Go to post

    Leave a comment:


  • sumittyagi
    started a topic replacing comma with newline

    replacing comma with newline

    Hi all,
    In ksh script, I have a comma separated list. I want to replace every third comma with newline. Please assist me in this.

    Thanks a lot!
    See more | Go to post

  • sumittyagi
    replied to displaying image stored in database.
    Now comming to javascript part:-
    Ajax currently returns only two types of responses, XML and text) it doesn't return other format. So you can't use ajax for this purpose, (as you can see from dmjpro's reply).

    Now images make their own separate request, so just use images, don't get complicated by using iframes.

    <img src="<path to your servlet>" id="target_img" >

    Now...
    See more | Go to post
    Last edited by acoder; Jan 20 '08, 06:13 PM. Reason: Added code tags

    Leave a comment:

No activity results to display
Show More
Working...