I have many Gaussian output files, which contain a string start from "HF=" but follws the different values. I'm trying to get this exact string from these txt files.
example 1,
example 2,
how to get "HF=-1277.1557592"( this value in one line or two lines) and put this value into a new file?
If you have a good suggestion, please help me!
Thanks!
Last edited by Franklin52; 10-19-2009 at 12:28 PM..
Reason: Please use code tags!!
...
I'm trying to get this exact string from these txt files.
example 1, 2.524075,-0.563322,-1.285286\H,0,-2.544438,-0.678834,1.199166\H,0,2.18
5962,-1.978001,0.018499\\Version=EM64T-G03RevE.01\State=5-A\HF=-1277.1
557592\S2=6.033269\S2-1=0.\S2A=6.000179\RMSD=8.037e-05\Thermal=0.\Dipo
le=-0.1643425,0.9094768,0.0321427\PG=C01 [X(C4H9Cr1O1)]\\@
example 2, 6256\H,0,-2.980236,0.00009,-0.45647\\Version=EM64T-G03RevE.01\State=5-
A\HF=-1198.5241253\S2=6.077753\S2-1=0.\S2A=6.000457\RMSD=4.977e-05\The
rmal=0.\Dipole=0.8534315,0.002042,-0.5745813\PG=C01 [X(C2H5Cr1O1)]\\@
...
If "example 1" and "example 2" are examples of a single lines (i.e. they do not span multiple lines in your text file), then here's a way to do it with Perl:
You can redirect the output to a new file using the shell's redirection operator.
tyler_durden
##
Sorry, did not read your post carefully.
For the ones that span multiple lines, here's how you can do it with Perl:
This code works very well. Thanks!
the output file like,
the only problem is that there is a space if the original number showed in two lines. how can i fix this problem??
thanks !
Last edited by Franklin52; 10-19-2009 at 12:29 PM..
Reason: Please use code tags!!
No, there are in different lines. some values stored in one single line, but some others stored in two lines ( from the end of one line to the beginning of the next line).
...
the only problem is that there is a space if the original number showed in two lines. how can i fix this problem??
...
If there is a space in your output file then it means there is a space in the HF value when it spans multiple lines.
The HF values in my test file were like so:
And your input file probably has this:
Notice how the Perl script, posted earlier, spews incorrect output for such a case:
That's because I am removing the newline but not the space. The following Perl script assumes that there could be one or more spaces in the HF value, and removes them.
If you think there could be tabs as well, then add "\t" within those square brackets in the s/// operator. Or you could also add "\s" to take care of all whitespaces.
Hello everyone,
Since my python knowledge is limimted, I've challenged myself to learn as much as possible to help me with my carrere. I'm currently trying to convert a shell script to python, just to give myself a task. There is one section of the script that I'm having issues converting and... (2 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Hi all.
I have a .txt file that I need to sort it
My file is like:
1- 88 chain0 MASTER (FF-TE) FFFF 1962510 /TCK T FD2TQHVTT1 /jtagc/jtag_instreg/updateinstr_reg_1 dff1 (TI,SO)
2- ... (10 Replies)
Hello.
Following recommendations for one of my threads, this is working perfectly :
#!/bin/bash
CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" )
Now I need a grep success for some thing like :
#!/bin/bash
CNT=$( grep -c -e "some text_1... (4 Replies)
logs:
"/home/abc/public_html/index.php"
"/home/abc/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
how to use "cut" or "awk" or "sed" to get the following result:
abc
abc
xyz
xyz
xyz (8 Replies)
Hi all;
Pretty green to perl programming; been searching high and low for a perl (preferably) or unix script that will compare 2 CSV strings in the same file that are separated buy the "|" character (so basically they're side by side) and give the results of ONLY the exact change; note that 19... (3 Replies)
I have a file that contains the 2 following lines (from /proc/mounts)
/dev/sdc1 /mnt/backup2 xfs rw,relatime,attr2,noquota 0 0
/dev/sdb1 /mnt/backup xfs rw,relatime,attr2,noquota 0 0
I need to match the string in the second column exactly so that only one result is returned, e.g.
> grep... (2 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hi Guru's,
I need to create 3 files with the contents "ABC" using single command.
Iam using:
echo "ABC" > file1.txt file2.txt file3.txt
the above command is not working. pls help me...
With Regards / Ganapati (4 Replies)