Sponsored Content
Top Forums Shell Programming and Scripting "How to get an exact string from a txt file?" Post 302363057 by liuzhencc on Monday 19th of October 2009 09:52:18 AM
Old 10-19-2009
To tyler_durden, thank you for your kind reply.

This code works very well. Thanks!
the output file like,
Code:
E201GECP.log
HF=-1270.9 206497
E202GECP.log
HF=-1270.91 25011
E301GECP.log
HF=-1349.1118043
E302GECP.log
HF=-1349.1068494
E313GECP.log
HF=-1349.1072849
E401GECP.log
HF=-1427.2934015
E407-2.log
HF=-1427.2920096

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!!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

echo "ABC" > file1.txt file2.txt file3.txt

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)
Discussion started by: ganapati
4 Replies

2. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

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)
Discussion started by: shis100
7 Replies

3. Shell Programming and Scripting

grep regex, match exact string which includes "/" anywhere on line.

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)
Discussion started by: jelloir
2 Replies

4. Shell Programming and Scripting

Compare two string and get "exact" difference only

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)
Discussion started by: gvolpini
3 Replies

5. Shell Programming and Scripting

how to use "cut" or "awk" or "sed" to remove a string

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)
Discussion started by: timmywong
8 Replies

6. Shell Programming and Scripting

grep with "[" and "]" and "dot" within the search string

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)
Discussion started by: jcdole
4 Replies

7. Shell Programming and Scripting

finding the strings beween 2 characters "/" & "/" in .txt file

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)
Discussion started by: Behrouzx77
10 Replies

8. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

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)
Discussion started by: asjaiswal
2 Replies

9. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

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)
Discussion started by: jcdole
1 Replies

10. Programming

[Python] replicating "sha256 -C checksum_file.txt file.txt"

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)
Discussion started by: da1
2 Replies
petitboot-nc(8) 					    BSD System Manager's Manual 					   petitboot-nc(8)

NAME
petitboot-nc -- Petitboot ncurses bootloader UI SYNOPSIS
petitboot-nc [-d, --start-daemon] [-h, --help] [-l, --log log-file] [-V, --version] DESCRIPTION
petitboot-nc is an ncurses based interface to the Petitboot bootloader. Petitboot is a Linux kexec based bootloader that supports loading Linux kernel and initrd images from any device that can be mounted by Linux. It can also load images from the network using the HTTP, HTTPS, NFS, SFTP, and TFTP protocols. OPTIONS
-d, --start-daemon Start pb-discover, the petitboot dynamic device discovery daemon, if it has not been started. This option is mainly useful when run- ning petitboot as a stand-alone application. -h, --help Print a help message. -l, --log log-file Log messages to the file log-file. The default log is a file /var/log/petitboot-nc.log. New messages are appended to an existing log file. -V, --version Display the program version number. SEE ALSO
petitboot(8), petitboot-twin(8), pb-discover(8), pb-event(8) REPORTING BUGS
Send bug reports to Geoff Levand <geoff @ infradead.org> BSD
June 1, 2019 BSD
All times are GMT -4. The time now is 08:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy