Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: script

  1. #1
    Join Date
    Oct 2019
    Beans
    6

    script

    Hi, i am new user of linux and i want pls script
    Last edited by aminedz22; October 22nd, 2019 at 09:44 PM.

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    18,821
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: script

    Is this work or a school assignment?
    Bash: https://www.tldp.org/LDP/Bash-Beginners-Guide/html/
    and https://www.tldp.org/LDP/abs/html/
    I would split the file to make processing easier using some delimiter. Don't be afraid to use temporary files as needed. If you can't clearly explain how to parse the entire file, then you can't create a program to parse it either.

    For certain problems, I'd use perl, python, ruby instead of bash, but you don't want this to be the first program for a language you don't know.

  3. #3
    Join Date
    Oct 2019
    Beans
    6

    Re: script

    Thank you for your reply,I am a student and the script will help me get the results quickly because I have a lot of files
    Last edited by QIII; October 20th, 2019 at 08:16 PM.

  4. #4
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    18,821
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: script

    Doing homework for students isn't something I do.

    We will help you fix a script, but you need to post specific questions. If I don't see some honest code attempted, I will not help.

    If the problem is not clearly stated, nobody can help. There simply isn't enough information provided so far.
    If all you care about is only the data for \Polar .... until \Quadrupole, then I'd remove all the other characters outside those delimiters using something like sed.

  5. #5
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    1,596
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: script

    are you asking for someone else to do all the work for you ... for free? or are you paying (advertising is not allowed here and we don't do quid pro quo). you don't even give details like what language to script in (bash, lua, perl, pike, python, ruby, etc). and your problem explanation makes no sense.
    You can't have my Windows 95 until you pry it from my cold dead 1 GB IDE hard drive.

  6. #6
    Join Date
    Oct 2019
    Beans
    6

    Re: script

    I want to use the script
    Last edited by aminedz22; October 22nd, 2019 at 09:45 PM.

  7. #7
    Join Date
    Oct 2019
    Beans
    6

    Re: script

    You have the time and patience to write without helping

  8. #8
    Join Date
    Jul 2008
    Location
    The Left Coast of the USA
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: script

    Now that you have worked on a script of your own, you might receive some help.

    Our purpose is to provide support, not to do projects for users.

    If you present a script and say "Why isn't this working", that would be support. Asking for the script to be written is not.
    Last edited by QIII; October 20th, 2019 at 08:20 PM.
    Please read The Forum Rules and The Forum Posting Guidelines

    A thing discovered and kept to oneself must be discovered time and again by others. A thing discovered and shared with others need be discovered only the once.
    This universe is crazy. I'm going back to my own.

  9. #9
    Join Date
    Aug 2010
    Location
    Lancs, United Kingdom
    Beans
    1,530
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: script

    Assuming your text is in a file data.txt then something like the following should get the values you are looking for.
    Code:
    tr -d '\n' < data.txt | sed 's/\\/\n\\/g' | fgrep '\Polar=' | sed 's/\\Polar=//'
    tr -d '\n' < data.txt | sed 's/\\/\n\\/g' | fgrep '\HyperPolar=' | sed 's/\\HyperPolar=//'
    This joins all the text into 1 line, splits the line at each backslash and finally greps for the required lines and removes the unwanted portion.

  10. #10
    Join Date
    Oct 2019
    Beans
    6

    Re: script

    a big thank-you

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •