Sponsored Content
Top Forums Shell Programming and Scripting Deleting certain new lines from a file with shell Post 302497200 by machalita on Wednesday 16th of February 2011 02:51:20 PM
Old 02-16-2011
Hi all, thanks for your help!!
I changed the
Code:
>> newfile

to
Code:
>newfile

, and the output its the same. I cant open the text file with gedit, and i cant open it with my software (which is suposed to do some analysis to the data).

But when i use
Code:
cat

, just like vgersh sugested, the data shows like its suposed to be. Here its the output from cat:

Code:
 
>seq_0
GTGAGATTGCTAATGAGCTGCTTTTAGGGGGCGTGTTGTGCTTGCTTTCCAACTTTTCTAGATTGATTCTACGCTGCCTCCAGCAGCCACCCCTCCCATCACCATTCCCATCACCATCCAGTCCCGTTGGCTCCCAGTCACAGTATTACACGTATGCAAATTAAGCCGAAGTTCAATTGCGACCGCAGCAACAACACGATCTTTCTACACTTCTCCTTGCTATGCTTGACATTCACAAGGTCAAAGCTCTTAATATTCTGGCTCGTGGCCCTACACTGTAAGAAATTACTATAGAAATAACGGTACACG
>seq_1
TTATGTCTCGATTCCAGCTAAATTGTCGCCTAAAGACGCCTCCGCCGGCGTTGAGCGCCGAGCAGCATCTGGCACGCATCGAGGTTTTCAATTCGCTGGCCGTGACAGCACCCCAAATCGAGGTGGACCGCCTGCGCTACGATAGGCGGCACAACATGAGCGGTAAGTGGATGCCACCAGCGGTTGGATCTGTGGGCGTGGCAGTGGGAGTGGGAGTACGTGCCAGTCACGGCTGCCGTACCACCCGAAAACCAAGTGCTGTGCCAAAAGCCCAAACATTTCGATTTCCTTCACTAATTACTTGTAAACACTCGTAACACTCGCAAATTAATTGGGGGGTTTCCTTCATGAGGTTTTCGCTTTCATCATATAATTGTATATAAATGTATGCCTTCGATTGAAGTTTGATATT
>seq_2
ACCAAAATAAATCTGGGAACTGAATAATCGAAAATAACTGGATGTGCATCATAAGATCTTCTTTTGAAGACTGACTACAGTTTGCAGCTCAGCGAGCTCGGGCCGGCAACTCAAGCCGGTCAACTCAAGTCAGGCGCCAATTCGCTGCTCCCACTCGCTCAGCTCTCTCAGTCACTCAAAATGGCAACGAGAGCAGAACGGTTCTTTTGCAAAATACTTTATGACCGGAGCAGAAGCAGAATCGGACCTCTGTCGCGGTCGCAGTCGCTGCCAGTGCTGACGGCGCTGTTGCGGCCGACGCTGACGCACATAAATAAAACGCTCTCTTTCGCTCACGAGTTTCTTATAAGACTTTATTTATATACTGCGCTGCCACCGCTGACTGCGCGCCGCCGCCGCCGACTGCGCTGGATTAATAAGGAGTTCTCGCTGGGATTTTCACATGTATATGCTTTGAATTGAATGCTTTATGGGTTTAGTTTGATAGGAGTCGTAAAGAAATCAACATCACACAA
>seq_3
TTCCTGACGAGATCGCTCTCTTTCCACAAATTCGAGTTGGGAAGCACGTGAGTAGAATTCAAAATGTTTTGCTTGCTGTTTTAAATATCACTAGGTTCTCAAACTAATTTCAAAAATAATCAAATTAAGTTCACAGAGCTGGCAAATAAAATGTAATAGCTTGCATGTATGNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCCATGGAAAATAAAGCCTTTGATATCCAGTTACTGATTCAGCGCCCAATTAATGCATGTTCCAAAAAAGTGTCAAAAAACGTGCACAAATCAAACGAGAGCTGAGGGCCCCGAATTCTATAGTGCTTA

And thats correct, but the problem is the "format" of the file that creates, at the moment i cant open the file except with cat. Any ideas? maybe convert the file?

---------- Post updated at 03:51 PM ---------- Previous update was at 03:39 PM ----------

Maybe its because i need a plain text file and im getting some kind of "rich" text file?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Deleting last 2 lines from the file.

Hi I have a file & always I need to remove or delete last 2 lines from that file. So in a file if I have 10 lines then it should return me first 8 lines. Can someone help me? (4 Replies)
Discussion started by: videsh77
4 Replies

2. Shell Programming and Scripting

Deleting lines in a file

How do I delete all the lines after the line containing text ***DISCLOSURES*** . I want to delete this line too. Thank you (2 Replies)
Discussion started by: reachsamir
2 Replies

3. UNIX for Dummies Questions & Answers

Deleting whole lines from a file

I have a file with 65 sets of 35 coordinates, and would like to isolate these coordinates so that I can easily copy the coordinates to another file. The problem is, I've got a 9 line header before each set of coordinates (so each set is 44 lines long). There are a zillion threads out there about... (3 Replies)
Discussion started by: red baron
3 Replies

4. UNIX for Advanced & Expert Users

Deleting lines from a file

How I can delete 100 lines anywhere in a file without opening a file and without renaming the file. (11 Replies)
Discussion started by: Nirgude07
11 Replies

5. Shell Programming and Scripting

deleting lines from file

We have a server that logs transactions to a file. I want to write a script that will delete the first 50 lines of the file daily without renameing the file or moving the file. (8 Replies)
Discussion started by: daveisme
8 Replies

6. Shell Programming and Scripting

deleting the lines at the end of the file.

I have a text file with two coulmn first column is just used in to show the line number, these line number are not there in the real file. I want to delete the line 16(in this file) here, even tough there is no data inside it . this empty line is causing me a problem by throwing me garbage... (12 Replies)
Discussion started by: shashi792
12 Replies

7. Shell Programming and Scripting

Shell deleting specific lines

Hi, I'am working under unix solaris I have a text file with set of lines, each set of lines (BLOCK) have three fixed lines : Between SECND line and THEND we have N lines, N differ from a block to another sample : i have to make a script wich delete each 3 fixed lines if N=0... (3 Replies)
Discussion started by: salbanito
3 Replies

8. Shell Programming and Scripting

Deleting specific lines in a file

Hello, I have a file like this one: 03-07-2011 sunz02 message1 03-07-2011 sunz02 message2 03-07-2011 sunz02 message3 01-07-2011 sunz02 message1 01-07-2011 sunz02 message2 01-07-2011 sunz02 ... (1 Reply)
Discussion started by: asanchez
1 Replies

9. Shell Programming and Scripting

deleting specific lines in a file

Hello, I have a file like: 26-07-2011 sunz02 message1 26-07-2011 sunz02 message2 26-07-2011 sunz02 message3 15-07-2011 sunz02 message1 15-07-2011 sunz02 message2 15-07-2011 sunz02 message3... (5 Replies)
Discussion started by: asanchez
5 Replies

10. Shell Programming and Scripting

deleting few lines from a file dynamically

here is the part of the code var1="replicate-ignore-db" var2="replicate-same-server-id" var3="skip-slave-start" var4="report-host" var5="master-host" var6="master-user" var7="master-password" var8="master-port" #code below deleted paramters as above if exists in my.cnf for i in 1 2 3 4... (4 Replies)
Discussion started by: vivek d r
4 Replies
Locale::Language(3perl) 				 Perl Programmers Reference Guide				   Locale::Language(3perl)

NAME
Locale::Language - standard codes for language identification SYNOPSIS
use Locale::Language; $lang = code2language('en'); # $lang gets 'English' $code = language2code('French'); # $code gets 'fr' @codes = all_language_codes(); @names = all_language_names(); DESCRIPTION
The "Locale::Language" module provides access to standard codes used for identifying languages, such as those as defined in ISO 639. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default ISO 639 two- letter codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying languages. The ones currently supported are: alpha-2 This is the set of two-letter (lowercase) codes from ISO 639, such as 'he' for Hebrew. This code set is identified with the symbol "LOCALE_LANG_ALPHA_2". This is the default code set. alpha-3 This is the set of three-letter (lowercase) bibliographic codes from ISO 639, such as 'heb' for Hebrew. This code set is identified with the symbol "LOCALE_LANG_ALPHA_3". term This is the set of three-letter (lowercase) terminologic codes from ISO 639. This code set is identified with the symbol "LOCALE_LANG_TERM". ROUTINES
code2language ( CODE [,CODESET] ) language2code ( NAME [,CODESET] ) language_code2code ( CODE ,CODESET ,CODESET2 ) all_language_codes ( [CODESET] ) all_language_names ( [CODESET] ) Locale::Language::rename_language ( CODE ,NEW_NAME [,CODESET] ) Locale::Language::add_language ( CODE ,NAME [,CODESET] ) Locale::Language::delete_language ( CODE [,CODESET] ) Locale::Language::add_language_alias ( NAME ,NEW_NAME ) Locale::Language::delete_language_alias ( NAME ) Locale::Language::rename_language_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Language::add_language_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Language::delete_language_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes man page. SEE ALSO
Locale::Codes Locale::Constants http://www.loc.gov/standards/iso639-2/ Source of the ISO 639 codes. AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 1997-2001 Canon Research Centre Europe (CRE). Copyright (c) 2001-2010 Neil Bowers Copyright (c) 2010-2011 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2011-09-26 Locale::Language(3perl)
All times are GMT -4. The time now is 02:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy