10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm trying to remove a specific number of lines, above and below a specific line of text, highlighted in red:
<STMTTRN>
<TRNTYPE>CREDIT
<DTPOSTED>20151205000001
<TRNAMT>10
<FITID>667800001
<CHECKNUM>667800001
<MEMO>BALANCE
</STMTTRN>
<STMTTRN>
<TRNTYPE>DEBIT
<DTPOSTED>20151207000001... (8 Replies)
Discussion started by: bomsom
8 Replies
2. UNIX for Dummies Questions & Answers
Hi Folks,
I am a novice and need to build a script in bash. I have 2 text files data.txt file is big file, column 2 is the we need to search and delete in the output. The filter file contains the rows to be deleted.
Data.txt
state city zone
Alabama Huntsville 4
California SanDiego 3... (3 Replies)
Discussion started by: tech_frk
3 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I have a large text file with the following format:
>gi|347545744|gb|JN204951.1| Dismorphia spio voucher 5
ATCAAATTCCTTCCTCTCCTTAAA
>gi|17544664774|gb|WN204922.32| Rodapara nigens gene region
CCGGGCAAATTCCTTCCTCTCCTTAAA
>gi|555466400|gb|SG255122.8| Bombyx mandariana genbank 3... (1 Reply)
Discussion started by: euspilapteryx
1 Replies
4. Shell Programming and Scripting
Hi,
I have one requiremnet like this. I need to find some particular string (eg.IncludeDateTime = ) in a file. And wherever it finds the string the unix script has to delete the remaining text coming after the string (ie., 'IncludeDateTime = ' ) in the same line. I tried to write this script in... (5 Replies)
Discussion started by: jannusuresh
5 Replies
5. Shell Programming and Scripting
Hi All,
I have a file.txt which seems like having three lines.
wc -l file.txt
3 file.txt
In fact, once it is open in text editor, this file has four lines where the last line is empty. how can i delete this last empty line of the file.txt? I tried the codes below so far but they... (6 Replies)
Discussion started by: senayasma
6 Replies
6. UNIX for Dummies Questions & Answers
PATTERN=""
sed "/$PATTERN/d" $file
In the file data is stored as
:::
:::
I need to delete only the line containing the PATTERN
pls help to point out why the above code is not working (4 Replies)
Discussion started by: thomsandy
4 Replies
7. UNIX for Dummies Questions & Answers
Hi,
How do I go about deleting a line in a text file. I have used grep to find a particlular word, now how do I delete the line?
so far I got:
grep -i $keyword file.txt (6 Replies)
Discussion started by: Berserk
6 Replies
8. Shell Programming and Scripting
My data is xml'ish (here is an excerpt) :-
<bag name="mybag1" version="1.0"/>
<contents id="coins"/>
<bag name="mybag2" version="1.1"/>
<contents id="clothes"/>
<contents id="shoes"/>
<bag name="mybag3" version="1.6"/>
I want to delete line containing mybag2 and its subsequent... (5 Replies)
Discussion started by: repudi8or
5 Replies
9. UNIX for Dummies Questions & Answers
hello experts,
I have a file: File1 Sample Test1
This is a Test
Sample Test2
Another Test
Final Test3
A final Test
I can use sed to delete the line with specific text
ie: sed '/Test2/d' File1.txt > File2.txt
How can I delete the line with the matching text and the line immediately... (6 Replies)
Discussion started by: orahi001
6 Replies
10. Shell Programming and Scripting
What command I can use to delete first line from any text file ?
Thk (5 Replies)
Discussion started by: aungomarin
5 Replies